Library

Guides Quick Fixes Scripts Find a Guide

Tools

Error Decoder Assessment Baselines Free Tools Service status What's Changed

More

AI Certifications For MSPs Recommended Gear Field Kit FAQ About Contact Get Assessment

How AI Platforms Connect to Microsoft 365 and Entra ID

EntraReady Guides · Practical Microsoft 365 & Entra ID
Last reviewed:
Last verified against Microsoft Learn:

An AI tool can't reach your Microsoft 365 data unless an identity in Microsoft Entra ID has been given permission. That applies to Microsoft Copilot, to an agent, and to an outside AI platform calling Microsoft Graph through an app you approved. Before you connect any of them, an admin needs five answers: which identity it runs as, what that identity can reach, how you narrow that, where its activity is logged, and how you turn it off quickly.

This guide covers the common paths and answers those questions for each. It ends with a comparison table, a report-first script and a checklist. It's part of the AI section.

Use it when: someone asks to connect an AI tool, connector, agent or MCP client to Microsoft 365, or you're auditing what AI already has access to.

Before you start

1. Microsoft Graph directly (an app registration)

Most outside AI platforms reach Microsoft 365 the same way any other app does. You register an app, or consent to a multitenant one, and it calls Microsoft Graph. Whatever you consent to shows up as an enterprise application (service principal) in your tenant.

Delegated vs application permissions

Narrow the scope

Credentials

Microsoft's credential guidance ranks the options (Credentials overview (opens in a new tab)):

  1. Managed identity with federated identity credentials (certificateless) for production on Azure.
  2. Certificates, for example in Azure Key Vault, when certificateless isn't available.
  3. Client secrets only in development. Microsoft says never use them in production.

If an outside platform needs a secret from an app you registered, that secret now lives outside your tenant, so give it a short expiry and track it. An invalid client secret shows up as AADSTS7000215, and an app that isn't found in the tenant shows up as AADSTS700016 (Error codes (opens in a new tab)).

When a connector only supports delegated sign-in

Some AI connectors only let a person sign in and approve delegated permissions. Because a delegated app can't reach more than the signed-in user can, who signs the connector in is your lever. If an admin does it, the AI can reach everything that admin can.

This is a compromise. Microsoft doesn't recommend user accounts as service accounts. It ranks them managed identity first, then service principal, then user account as a last resort (Govern service accounts (opens in a new tab)). If you must use a user account:

Limits: one shared account means the logs show the account, not the person who asked the AI. If the tool can run as its own app registration, use that instead, with Sites.Selected, RBAC for Applications, a certificate or managed identity, and Conditional Access for workload identities (opens in a new tab) where licensed.

2. Copilot connectors and plugins

This path runs in two directions:

For the "in" direction, ask which account the connector uses to reach the source, and whether the source's permissions map cleanly. For the "out" direction, ask what the external API can do once Copilot calls it, and whose token it gets.

3. Agents with their own identity (Microsoft Entra Agent ID)

Microsoft Entra Agent ID is generally available. Local agent authentication, blueprint instance modes and Client ID Metadata Document (CIMD) support are in preview (What's new in Agent ID (opens in a new tab)).

Conditional Access for agents: target the right subject

Each token has one subject, and policies apply to that subject only (Agent access patterns (opens in a new tab)):

The agent… Token subject Target the policy at
acts on behalf of a signed-in user (OBO) the user users and groups (agent selection doesn't cover OBO)
acts as itself (app-only) the agent identity the agent identity or its blueprint
acts through its own user account the agent's user account Agents > agent users

Some limits apply (Boundaries and limitations (opens in a new tab)):

There are templates, including one that blocks high-risk agent identities (What's new: Protect agent access (opens in a new tab)). Licensing is Microsoft 365 E7, or a Microsoft Agent 365 license paired with at least Microsoft Entra ID P1 or Microsoft 365 E3 (Requirements and licensing (opens in a new tab)).

Example: Autopilot in Microsoft Copilot (preview)

Autopilot (shown as Autopilot (Frontier) in admin pages, and unrelated to Windows Autopilot) is a persistent, cloud-based agent with its own workplace identity, mailbox and calendar. Microsoft says it doesn't expand what the user can access (Autopilot overview (opens in a new tab)).

Logs and off switches for any agent

4. MCP servers you own

The Model Context Protocol (MCP) is an open standard for how AI models call tools (MCP Server for IT Admins overview (opens in a new tab)). The useful admin pattern is your own MCP server in front of Graph. It exposes a few narrow tools instead of raw Graph access, and the model can only call what the server exposes.

5. Microsoft MCP Server for IT Admins (formerly MCP Server for Enterprise)

Microsoft runs its own MCP server, at https://mcp.svc.cloud.microsoft/admin, that turns natural-language requests into Microsoft Graph calls. Microsoft Entra is read and write, and Microsoft Intune is read-only, excluding the Intune reporting APIs. Mail, files and Teams aren't covered; Microsoft points to Work IQ MCP for those. It's available in the global cloud only (Overview (opens in a new tab)).

The old MCP Server for Enterprise endpoint (/enterprise) is deprecated. It keeps working "for a few months" while you migrate (Overview (opens in a new tab)).

6. Power Platform and Logic Apps as a middle layer

Here the AI never holds the Microsoft 365 permission. It calls a flow or Logic App you control, and that layer holds the permission and does one job. That gives you one place to validate input, add approval, log and switch off.

Side-by-side

Path Runs as How to scope it Where to log How to revoke
Microsoft Graph app Signed-in user (delegated) or the app's service principal (application) Least-privilege scopes, *.Selected, RBAC for Applications, admin consent only Sign-in logs (user and service principal), audit logs, Graph activity logs Disable the service principal, remove grants, delete credentials
Copilot connectors and plugins Connector: its connection account, with source ACLs. Plugin: whatever the external API authenticates Which connections exist; the source account; the plugin's MCP server or API Microsoft 365 admin center, source system, external API logs Remove the connection or plugin; revoke the OAuth app in the external service
Agent with Agent ID (e.g. Autopilot) Agent identity, agent user, or the user via OBO Conditional Access aimed at the right subject; blueprint-level policies; activation scope and spending policy Sign-in logs (Is Agent), audit logs (agentType), unified audit log Disable the blueprint; block or delete the instance
Your own MCP server User (delegated) or the server's identity Narrow tools; minimum Graph permissions Server logs, sign-in logs, Graph activity logs Turn off the server or its auth; disable its service principal
MCP Server for IT Admins Signed-in user via your client app (delegated only) Client's Graph permissions, user roles and PIM, Assignment required, tool selection Graph activity logs (app ID e8c77dc2-…), client app sign-ins and audit Disable or unassign the client app; remove consent; revoke sessions
Flow / Logic App Connection account or managed identity Dedicated connections, data policies, one job per endpoint Run history, Azure logs, managed identity sign-ins Turn off the flow; remove the connection or the identity's permissions

Report-first PowerShell

This script lists every app holding Microsoft Graph application permissions, the delegated Graph grants, and your agent identities. It changes nothing.

Scopes: - Application.Read.All (List appRoleAssignedTo (opens in a new tab)) - Directory.Read.All (List oauth2PermissionGrants (opens in a new tab)) - AgentIdentity.Read.All (List agentIdentity objects (beta) (opens in a new tab)). Non-owners need Agent ID Administrator for this call.

# Read-only.
Connect-MgGraph -Scopes "Application.Read.All","Directory.Read.All","AgentIdentity.Read.All"
# Microsoft Graph's own service principal (well-known appId)
$graphSp = Get-MgServicePrincipal -Filter "appId eq '00000003-0000-0000-c000-000000000000'"
$roleName = @{}; $graphSp.AppRoles | ForEach-Object { $roleName[$_.Id] = $_.Value }
$scopeOwner = @{}
# 1. Apps holding Microsoft Graph APPLICATION permissions (app-only, tenant-wide)
Get-MgServicePrincipalAppRoleAssignedTo -ServicePrincipalId $graphSp.Id -All |
Select-Object PrincipalDisplayName, PrincipalId, @{n="Permission";e={$roleName[$_.AppRoleId]}}, CreatedDateTime |
Sort-Object PrincipalDisplayName | Format-Table -AutoSize
# 2. DELEGATED grants on Microsoft Graph (AllPrincipals = admin consented for everyone)
Get-MgOauth2PermissionGrant -All | Where-Object { $_.ResourceId -eq $graphSp.Id } | ForEach-Object {
if (-not $scopeOwner[$_.ClientId]) { $scopeOwner[$_.ClientId] = (Get-MgServicePrincipal -ServicePrincipalId $_.ClientId).DisplayName }
[pscustomobject]@{ Client = $scopeOwner[$_.ClientId]; ConsentType = $_.ConsentType; PrincipalId = $_.PrincipalId; Scopes = $_.Scope }
} | Sort-Object Client | Format-Table -Wrap
# 3. Agent identities (beta API; may change)
$agents = Invoke-MgGraphRequest -Method GET -Uri "https://graph.microsoft.com/beta/servicePrincipals/microsoft.graph.agentIdentity?`$select=id,displayName,createdDateTime,agentIdentityBlueprintId,accountEnabled"
$agents.value | ForEach-Object { [pscustomobject]$_ } | Format-Table displayName, accountEnabled, agentIdentityBlueprintId, createdDateTime -AutoSize

The appId 00000003-0000-0000-c000-000000000000 is Microsoft Graph's, as used in Microsoft's own example (Retrieve permission IDs (opens in a new tab)). Application permissions produce appRoleAssignment objects, and delegated permissions produce oAuth2PermissionGrant objects (Comparison (opens in a new tab)). Results are paged at 100 agent identities per call, so follow @odata.nextLink in large tenants (List agentIdentity (opens in a new tab)).

Gotchas

Check it worked (admin checklist)

  1. Inventory: the script output matches what you expect. Every app with Graph application permissions, and every AllPrincipals delegated grant, has an owner and a reason.
  2. Consent: user consent is off or limited, and the admin consent workflow is on (App consent, Admin consent requests).
  3. Sign-in logs: check all four types (interactive, non-interactive, service principal and managed identity), plus Is Agent (Sign-in logs (opens in a new tab)). See Sign-in logs.
  4. Graph activity logs are flowing to a destination (Graph activity logs (opens in a new tab)).
  5. Conditional Access: workload identity and agent policies are assigned to the right subjects, break-glass accounts are excluded, and changes are tested in report-only (Report-only (opens in a new tab)).
  6. Credentials: managed identities and certificates are preferred, and there are no client secrets in production (Credentials overview (opens in a new tab)).

Roll back (revocation, in order)

  1. Disable the service principal. Under Enterprise applications > the app > Properties, set Enabled for users to sign-in? to No. That sets accountEnabled to false, so no new tokens are issued (Disable user sign-in (opens in a new tab)). For agents, disable the blueprint (Agent identity blueprints (opens in a new tab)).
  2. Remove grants: delegated permission grants, app role assignments, and any *.Selected or RBAC for Applications assignments.
  3. Delete credentials on the app registration, or the blueprint.
  4. Revoke sessions for users whose delegated tokens the tool held (revokeSignInSessions (opens in a new tab)).
  5. Allow for token lifetime (see Gotchas). For Autopilot, Microsoft says changes take about an hour.

Related on EntraReady: App consent and risky OAuth permissions, Admin consent requests, Too many Global Admins, PIM for admin roles, Sign-in logs, Phishing-resistant MFA with hardware keys.

What changed

Compared with the live version (last reviewed Nov 24, 2026):

← All Guides

Is this still accurate?

Spotted something outdated or wrong on this page? Tell us in a sentence. The page address is sent with it.

Reports go to the EntraReady inbox. Please don’t include passwords or tenant secrets.