Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
This feature is for public preview customers only. Features in preview might not be complete and could undergo changes before becoming available in the broader release.
Microsoft Copilot Studio sends agents metrics to Viva Insights, which populate the Copilot Studio agents report. This article shows you how to delete Copilot Studio agents data in Viva Insights.
Important
If you delete Copilot Studio agents data, the data can't be recovered. This also stops further data processing, so analysts won't be able to run new reports that use Copilot Studio agents data.
Queries you ran before you deleted Copilot Studio agents data are also no longer available to analysts.
You can't un-do this deletion.
Workflow
The Viva Insights Administrator or, depending on your organization's settings, the tenant admin registers an Azure application.
The tenant admin grants consent to the application to access the Viva Insights API.
The Viva Insights Administrator runs a PowerShell cmdlet to delete Copilot Studio agents data in Viva Insights.
1. Register a new app in Azure
Applies to: Viva Insights Administrator or tenant admin
Sign in to the Microsoft Entra admin center.
Navigate to Identity > Applications > App registrations and select New registration.
On the next screen:
- Give your app a name.
- Under Supported account types, leave the first option, Accounts in this organizational directory only ([Your organization] only - Single tenant), selected.
- Under Redirect URI (optional), select Public Client/native (mobile and desktop) and provide the following URI:
https://login.microsoftonline.com/common/oauth2/nativeclient
. - At the bottom, select Register.
On the Overview screen, copy the Application (client) ID and Directory (tenant) ID. Keep these IDs handy. You'll need them later.
Add an API permission:
- Select API permissions, then Add a permission and select APIs my organization uses.
- In the search bar, enter "Workplace Analytics."
- Select Workplace Analytics and select Delegated permissions.
- Under Select permissions, select AdministratorSettings.ReadWrite.
- Select Add permissions.
Remove API permissions:
- On the left, select API permissions.
- For the Microsoft Graph API, select the ellipsis (...) to the right of the API and select Remove permission.
- Confirm removal.
When you remove permissions for the Microsoft Graph API, you're making sure the app only has permissions for what it needs.
2. Grant admin consent to the application
Applies to: Viva Insights Administrator and tenant admin
The Viva Insights Administrator asks the tenant admin to grant permission to this app to access Viva Insights resources. Learn more about permissions and consent.
3. Run the PowerShell cmdlet
Applies to: Viva Insights Administrator
Launch Terminal on Windows.
Execute the git clone command followed by the repository URL:
git clone https://github.com/microsoft/vivainsights_copilotstudioagentsdelete.git
Navigate to the folder: cd vivainsights_copilotstudioagentsdelete/PowerShellApp
Run the script using the Application (client) ID and the Directory (tenant) ID you saved:
.\CopilotAgentsDelete.ps1 -[ClientId] -[TenantId]