Tutorial: Register an app with Microsoft Entra ID
This tutorial describes how to register an application with Microsoft Entra ID, which enables a user with a Power Apps user account to connect to their Microsoft Dataverse environment from external client applications using OAuth authentication.
Important
Power Apps also provides you with a Server-to-Server (S2S) authentication option to connect to Dataverse environment from external applications and services using the special application user account. Using S2S authentication is a common way that apps registered on Microsoft AppSource use to access the data of their subscribers. More information: Build web applications using Server-to-Server (S2S) authentication.
App registration in Microsoft Entra ID is typically done by ISVs who want to develop external client applications to read and write data in Dataverse. Registering an app in Microsoft Entra ID 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 Dataverse environment by providing their Dataverse credentials, a consent form is presented to the end user. After consenting to use their Dataverse account with the ISV's application, end users can connect to Dataverse environment from the 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 Microsoft Entra ID can be multi-tenant, which implies that other Dataverse users from other tenant can connect to their environment 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 Dataverse. Use the Application ID and Redirect URI values from your registered app in your client application's authentication code to connect to a Dataverse environment from your client application, and perform the required operations. Note that if the app is registered in the same tenant as your Dataverse environment, you won't be presented with a consent form when connecting from your client application to your Dataverse environment.
Prerequisites
- A Microsoft Entra subscription for application registration. A trial account will also work.
Note
If you don't have an Azure tenant (account) or you do have one but your Microsoft 365 subscription with Dataverse is not available in your Azure subscription, follow the instructions in the topic Set up Microsoft Entra ID 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: Microsoft Entra ID Pricing Details
Create an application registration
To create an application registration, follow these steps.
Sign in to the Microsoft Azure portal using an account with administrator permission. You must use an account in the same Microsoft 365 subscription (tenant) as you intend to register an app with. On the Home page of the portal under Azure services select Microsoft Entra ID.
Alternately, you can also access the Azure portal through the Microsoft 365 Admin center by first choosing the All admin centers item in the left navigation pane, select Microsoft Entra, and then select Go to Microsoft Entra ID. Next, in the left navigation pane of the Microsoft Entra admin center, expand the Applications node.
In the left navigation pane select App registrations and then select + New registration on the App registrations page.
On the App registrations page, enter your application's registration information as described below.
Form input element Description Name Enter a meaningful application name that will be displayed to users. Supported account types Select the Accounts in any organizational directory option. Redirect URI This field is optional when using client secret or certificate authentication. For basic username/password authentication, supply a redirect URI. The redirect URI value must be a valid value, however the specified URI is not required to exist. Select Register to create the application registration. The app registration overview page is shown. Remain on that page.
On the Overview page of your newly created app, hover the cursor over the Application (client) ID value, and select the copy to clipboard icon to copy the ID value. Record the value somewhere. You'll need to specify this value later in your application's authentication code or app.config file where appropriate.
Select Manifest in the left navigation panel. In the manifest editor, set the
allowPublicClientproperty totrueand select Save.{ "id": "219db142-b8e2-4645-9434-44a4516b8968", "acceptMappedClaims": null, "accessTokenAcceptedVersion": null, "addIns": [], "allowPublicClient": true, "appId": "4bfce595-7819-423c-b0bd-a053ff97fb99", "appRoles": [], "oauth2AllowUrlPathMatching": false,In the left navigation panel, select API permissions and then select Add a permission.
Select the APIs my organization uses tab, and then in the search field, enter "Dataverse" to search for the Dataverse entry. Select the Dataverse item in the search results list.
On the Request API permissions page, select Delegated permissions. Next, select (check) the user_impersonation option, and then select Add permissions.
Note
For a server-to-server (S2S) scenario, you do not need to check the user_impersonation option. More information: Use multi-tenant server-to-server authentication
This completes the basic app registration in Microsoft Entra ID. If you want to add a certificate or client secret to your app registration, simply select Certificates & secrets in the left navigation panel and add those items.
See also
Application registration in Microsoft Entra ID
Authenticate Users with Dataverse Web Services
Feedback
Submit and view feedback for