Skip to main content
TrustLens connects to Microsoft 365 Copilot and Copilot Studio using an Azure AD service principal. It discovers bots and agents from three sources:
  • Copilot Studio bots — via the Dataverse API (authoritative source)
  • M365 Copilot agents — via the Microsoft Graph Agent Registry (beta)
  • Teams app catalog agents — via Microsoft Graph (optional, disabled by default)
When a bot exists in both Copilot Studio (Dataverse) and the Agent Registry, the Dataverse entry is used as the authoritative record and the duplicate is filtered out automatically.

What TrustLens discovers

Copilot Studio bots

M365 Copilot agents

Usage metrics

TrustLens counts conversations per bot by reading Dataverse conversation transcripts. For each bot, total_runs equals the number of transcript records linked to it.
Token counts, latency, and per-user metrics are not available for Copilot Studio bots. Microsoft does not expose this data via Dataverse or the Graph API at the individual bot level.

Required permissions

The minimum viable setup requires only the Dataverse configuration below. The Graph permission is needed only if you also want to discover M365 Copilot agents (distinct from Copilot Studio bots).

Copilot Studio bots (Dataverse) — always required

Dataverse — System Customizer role (as Application User) The service principal must be registered as an Application User in your Power Platform environment and granted the System Customizer security role. This role provides read access to the bot, botcomponent, and conversationtranscript Dataverse tables that TrustLens queries.
System Administrator is not required and grants excessive permissions. System Customizer is the correct minimum role for this integration.
Dataverse URL You must provide the URL of the Dataverse environment where your Copilot Studio bots are deployed. This is not auto-discovered (unless you grant the optional Power Platform Administrator role below). Where to find it: Power Platform Admin Center → Environments → select your environment → Environment URL Example: https://org1234567.crm4.dynamics.com

M365 Copilot agents (Graph Agent Registry) — for M365 agent discovery only

Microsoft Graph application permission — AgentInstance.Read.All Required only to discover M365 Copilot agents via the Graph Agent Registry (beta). If you only need Copilot Studio bot discovery, you can skip this permission — the integration will still work via Dataverse.
If AgentInstance.Read.All is not granted and the integration returns a 403 or 404 from the Graph Agent Registry endpoint, this is expected when skipping M365 agent discovery. Only Dataverse-sourced bots will appear.

Optional permissions

The Power Platform Administrator role alone is not sufficient for auto-discovery. The service principal must also be registered as a Power Platform management application (Step 5).

Step-by-step setup

1

Create an app registration

  1. Go to Azure Portal → App registrations
  2. Click New registration
  3. Name: neuraltrust-trustlens (or any name you prefer)
  4. Supported account types: Single tenant (This organization only)
  5. Click Register
  6. Note the Application (client) ID and Directory (tenant) ID
  7. Go to Certificates & secretsNew client secret, set an expiry, and copy the value immediately
2

Add Microsoft Graph API permissions

  1. In the app registration, go to API permissionsAdd a permission
  2. Select Microsoft GraphApplication permissions
  3. Add the following permissions:
  1. Click Grant admin consent for [your tenant] — a Global Administrator must approve
3

Register the service principal as a Dataverse Application User

The service principal must be added as an Application User in your Power Platform environment and granted the System Customizer security role.
  1. Go to Power Platform Admin Center
  2. Select Environments → click your environment → SettingsUsers + permissionsApplication users
  3. Click + New app user
  4. Select your app registration
  5. Assign the System Customizer security role
  6. Click Create
4

Find your Dataverse URL

  1. Go to Power Platform Admin Center
  2. Select Environments → click your environment
  3. Copy the Environment URL (e.g., https://org1234567.crm4.dynamics.com)
You will enter this URL when configuring the integration in TrustLens.
5

(Optional) Register as Power Platform management application

Required only if you want environment auto-discovery. This is a one-time operation that must be performed by a Global Admin or Power Platform Admin user account (not the service principal itself).
Then assign the Power Platform Administrator directory role to the service principal:
Directory role assignments can take up to 60 minutes to propagate.
6

Configure the integration in TrustLens

Provide the following when creating the M365 Copilot integration:

Security controls assessed

For each Copilot Studio bot, TrustLens evaluates the following security controls:

Known limitations


Security considerations

  • The service principal has read-only access to Dataverse and the Graph API. It cannot create, modify, or delete bots, users, or any other resources.
  • The client secret should be rotated regularly. Update the integration when you rotate it.
  • All credentials are encrypted at rest.
  • The System Customizer role in Dataverse is the minimum required. Do not assign System Administrator as it grants unnecessary write access.

Troubleshooting

  • The service principal has not been registered as a Power Platform management application (Step 5). This is required in addition to the directory role assignment.
  • The Power Platform Administrator directory role assignment may not have propagated yet — wait up to 60 minutes.
  • This error only affects environment auto-discovery. If you provide the Dataverse URL manually, the integration works without this role.
  • Verify the Application User exists in your Dataverse environment: Power Platform Admin Center → Environment → Settings → Users + permissions → Application users.
  • Verify the Application User has the System Customizer security role.
  • Verify the dataverse_url provided is correct and corresponds to the environment where your bots are deployed.
  • Verify the Application User has access to the conversationtranscript entity — this is covered by the System Customizer role.
  • Bots must have actual user conversations to generate transcript records. Bots with no usage correctly show zero.
  • The client secret may have expired. Generate a new secret and update the integration.
  • The Application User may have been disabled in Dataverse. Re-enable it in the Power Platform Admin Center.
  • If you see more agents than expected, the Dataverse connection may not be working (missing URL, inaccessible, or Application User misconfigured). Without a working Dataverse connection, TrustLens cannot filter duplicate entries from the Agent Registry.
  • Verify the Dataverse URL and Application User configuration.