Share via


Delete Copilot Studio agents data in Viva Insights (preview)

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

  1. The Viva Insights Administrator or, depending on your organization's settings, the tenant admin registers an Azure application.

  2. The tenant admin grants consent to the application to access the Viva Insights API.

  3. 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

  1. Sign in to the Microsoft Entra admin center.

  2. Navigate to Identity > Applications > App registrations and select New registration.

    1. On the next screen:

      1. Give your app a name.
      2. Under Supported account types, leave the first option, Accounts in this organizational directory only ([Your organization] only - Single tenant), selected.
      3. Under Redirect URI (optional), select Public Client/native (mobile and desktop) and provide the following URI: https://login.microsoftonline.com/common/oauth2/nativeclient.
      4. At the bottom, select Register.

      Screenshot that shows how to register the app.

    2. On the Overview screen, copy the Application (client) ID and Directory (tenant) ID. Keep these IDs handy. You'll need them later.

      Screenshot that shows the application and directory IDs.

  3. Add an API permission:

    1. Select API permissions, then Add a permission and select APIs my organization uses.
    2. In the search bar, enter "Workplace Analytics."
    3. Select Workplace Analytics and select Delegated permissions.
    4. Under Select permissions, select AdministratorSettings.ReadWrite.
    5. Select Add permissions.
  4. Remove API permissions:

    1. On the left, select API permissions.
    2. For the Microsoft Graph API, select the ellipsis (...) to the right of the API and select Remove permission.
    3. Confirm removal.

    When you remove permissions for the Microsoft Graph API, you're making sure the app only has permissions for what it needs.

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

  1. Launch Terminal on Windows.

  2. Execute the git clone command followed by the repository URL:

    git clone https://github.com/microsoft/vivainsights_copilotstudioagentsdelete.git
    
  3. Navigate to the folder: cd vivainsights_copilotstudioagentsdelete/PowerShellApp

  4. Run the script using the Application (client) ID and the Directory (tenant) ID you saved:

    .\CopilotAgentsDelete.ps1 -[ClientId] -[TenantId]
    

Copilot Studio agents report