Microsoft tutorial: Connecting Foundry AI agents to Dataverse via MCP
Microsoft has published a tutorial for connecting AI agents in Microsoft Foundry to Dataverse using the Model Context Protocol, claiming the integration can be completed in under 30 minutes. The setup requires an Entra ID app registration, specific API permissions, an admin-enabled setting, and careful configuration of OAuth endpoints. However, the process still involves credential management and has potential failure modes such as mismatched URLs and missing admin consent.

Listen to this dispatch
Narrated by an AI-generated voice.
How Foundry agents reach Dataverse over MCP
Rendering diagram…
Microsoft has published a step-by-step tutorial for connecting AI agents built in Microsoft Foundry to Dataverse, the underlying data platform for Dynamics 365 and Power Platform. The setup uses the Model Context Protocol (MCP) via Microsoft's Dataverse MCP Server, which gives agents access to business data—accounts, opportunities, workflows—through standard MCP tool calls. The tutorial says this integration work, which typically takes weeks when done custom, can be completed in under 30 minutes.
The process requires more moving parts than a simple API key. An app registration in Microsoft Entra ID establishes a trusted identity for the MCP client. That registration needs API permissions for Dynamics CRM, plus OAuth scopes (offline_access, openid, profile), and an admin must grant consent. A client secret is generated and captured alongside the tenant and client IDs.
Before any agent can connect, an environment setting in the Power Platform admin center must be enabled: "Allow MCP clients to interact with Dataverse MCP server." If that toggle is off, requests are denied.
Inside Microsoft Foundry, the agent adds a custom MCP tool pointed at https://<organization>.crm.dynamics.com/api/mcp. Authentication uses OAuth 2.0 against Microsoft Entra ID, with token and authorization URLs built from the tenant ID. The refresh URL must match the token URL exactly. After connecting, Foundry provides a redirect URI that must be pasted back into the app registration's Authentication tab—a step that's easy to miss and produces immediate failures if skipped.
The full flow works as follows: a user asks the agent for a list of accounts, which triggers a sign-in prompt to Dynamics 365, a consent screen, and then an MCP tool invocation that requires approval. Results appear in the agent's chat interface and in the Dataverse table view.
Three common failure modes are documented. A 401 Unauthorized error points to missing admin consent or an expired client secret. A failed MCP connection usually means the admin center setting wasn't enabled. Token refresh problems trace back to the refresh URL not matching the token URL.
Provisioning Microsoft Foundry itself is out of scope, and the security model—what a user can and cannot do through the agent after authentication—isn't covered. Custom connectors and the MCP server's behavior at scale are also not addressed. If the 30-minute claim holds, it's a useful shortcut for teams already inside the Microsoft ecosystem. But the setup still requires careful credential handling and the usual Entra ID plumbing.
Read the original at techcommunity.microsoft.com →