Walkthrough: Register a Dynamics 365 for Customer Engagement app with Azure Active Directory
This walkthrough describes how to register an application with Azure Active Directory, which enables a user with Dynamics 365 for Customer Engagement user account to connect to their Dynamics 365 for Customer Engagement Online instance from external client applications using OAuth authentication.
Dynamics 365 for Customer Engagement also provides you with Server-to-Server (S2S) authentication option to connect to Dynamics 365 for Customer Engagement Online instance from external applications and services using the special application user account. S2S authentication is the common way that apps registered on Microsoft AppSource use to access the Dynamics 365 for Customer Engagement data of their subscribers. More information: Build web applications using Server-to-Server (S2S) authentication.
App registration in Azure Active Directory is typically done by ISVs who want to develop external client applications to read and write data in Customer Engagement. Registering an app in Azure Active Directory provides you with Application ID and Redirect URI values that ISVs can use in their client application's authentication code. When end users use the ISV's application for the first time to connect to their Customer Engagement instance by providing their Customer Engagement credentials, a consent form is presented to the end user. After consenting to use their Customer Engagement account with the ISV's application, end users can connect to Customer Engagement instance from external application. The consent form is not displayed again to other users after the first user who has already consented to use the ISV's app. Apps registered in Azure Active Directory are multi-tenant, which implies that other Customer Engagement users from other tenant can connect to their instance using the ISV's app.
App registration can also be done by an application developer or individual user who is building a client application to connect to and read/write data in Customer Engagement. Use the Application ID and Redirect URI values from your registered app in your client application's authentication code to be able to connect to Customer Engagement instance from your client application, and perform the required operations. Note that if the app is registered in the same tenant as your Customer Engagement instance, you won't be presented with a consent form when connecting from your client application to your Customer Engagement instance.
The user who is registering the application must have a Dynamics 365 for Customer Engagement user account with System Administrator security role and the global administrator role for the Office 365 subscription.
An Azure subscription for application registration. A trial account will also work.
How to: Register an application with Microsoft Azure Active Directory
Sign in to the Azure portal using an account with administrator permission. You must use an account in the same Office 365 subscription (tenant) as you intend to register the app with. You can also access the Azure portal through the Office 365 Admin center by expanding the Admin centers item in the left navigation pane, and selecting Azure Active Directory.
If you don’t have an Azure tenant (account) or you do have one but your Office365 subscription with Dynamics 365 for Customer Engagement is not available in your Azure subscription, following the instructions in the topic Set up Azure Active Directory access for your Developer Site to associate the two accounts.
If you don’t have an account, you can sign up for one by using a credit card. However, the account is free for application registration and your credit card won’t be charged if you only follow the procedures called out in this topic to register one or more apps. More information: Active Directory Pricing Details
In the Azure portal, select Azure Active Directory in the left pane and select App registrations and click on New registration.
In the Register an application page, enter your application's registration information:
In the Name section, enter a meaningful application name that will be displayed to the users.
Select Accounts in any organizational directory option from Supported account types section.
Set the Redirect URI.
Click on Register to create the application.
On the app Overview page, hover over Application (client) ID value, and select the Copy to clipboard icon to copy the value as you’ll need to specify this in your application’s authentication code or app.config file where appropriate.
Select Manifest tab, in the manifest editor, set the allowPublicClient* property to true and click on Save.
Select API permissions tab, click on Add a permission.
Select Dynamics CRM under the Microsoft APIs tab.
Click on Delegated permissions and check the options and click on Add permissions.
This completes the registration of your application in Azure Active Directory.