This guide walks you through creating a secure Web API integration between Microsoft Dataverse (used by Dynamics 365) and an external system using Azure Active Directory (Azure AD) authentication.
✅ Prerequisites
-
Admin access to the Azure Portal
-
Admin access to the Power Platform admin center
-
Admin or System Customizer access to the target Dynamics 365 environment
-
A licensed Dataverse environment (e.g., Dynamics 365 Sales)
🧩 Step 1: Register an App in Azure AD
-
Go to Azure Portal
-
Navigate to Azure Active Directory > App registrations
-
Click New registration
-
Fill in the form:
-
Name: e.g.,
DataverseIntegrationApp
-
Supported account types: Select Accounts in this organizational directory only
-
Redirect URI: Leave blank (or add later if needed)
-
-
Click Register
📌 After registration, note down:
-
Application (client) ID
-
Directory (tenant) ID
🔐 Step 2: Generate a Client Secret
-
In the same app, go to Certificates & secrets
-
Under Client secrets, click New client secret
-
Set a description and expiration
-
Click Add
-
Copy the secret value immediately – you won’t be able to view it again later
🔗 Step 3: Assign API Permissions
-
Go to API permissions > Add a permission
-
Choose Dynamics CRM
-
Select:
-
Application permissions (for server-to-server integration)
-
-
Check user_impersonation
-
Click Add permissions
-
Click Grant admin consent for your organization (must be done by an Azure AD admin)
🧑💻 Step 4: Create an Application User in Dataverse
-
Select Environments > open your target environment
-
Click Settings on the top menu
-
Under Users + permissions, select Application users
-
Click + New app user
-
In the pane:
-
Click Add an app, select your Azure-registered app (from Step 1), then click Add
-
-
Click Next and assign appropriate security roles (e.g., System Customizer or a custom role with needed permissions)
-
Click Create
✅ This application user now represents your Azure AD app within the specific Dynamics 365 environment.
🌐 Step 5: Get Your Dataverse Web API URL
-
In Dynamics, click the gear icon → Advanced Settings
-
In the classic settings page, go to Customizations > Developer Resources
-
Find and copy the Service Root URL, e.g.:
🔑 Share These Details With Your Integration Partner
To enable the integration (e.g., with Contraqer or another vendor), provide the following:
Item | Source |
---|---|
Tenant ID | Azure AD > App Registration |
Client ID | Azure AD > App Registration |
Client Secret | Azure AD > Certificates & Secrets |
API URL | D365 > Developer Resources |
🎯 You're Ready!
The Azure app is now authorized to access your Dataverse environment securely via Web API. You can use this setup for custom apps, vendor integrations, or backend services interacting with D365 data.
Let me know if you want this exported to PDF or used in an internal documentation portal!
No comments:
Post a Comment