(Example) How to Get the Access Token Credentials from Microsoft Dataverse
To get the access token credentials from Microsoft Dataverse, do the procedure in this topic.
Background and Setup
Prerequisites
- One of these Microsoft 365 account types with a Microsoft Power Automate license:
- Microsoft 365 Home
- Microsoft 365 Personal
Good to Know
- OAuth 2.0 access tokens require a 2-way exchange of credentials between AgilePoint NX and the external service. This means that you must get the credentials from the third-party service to paste in the AgilePoint NX access token, and get the redirect URI from AgilePoint NX to paste in the external service. This requires you to open both the AgilePoint NX access token and the third-party service at the same time, so you can copy and paste from one screen to the other.
This topic shows the suggested procedure for Microsoft Dataverse. The exact procedure for your access token depends on whether you already have a connection (usually called an app) configured in the external service.
- This topic gives one example. The procedure may vary depending on your configuration and account settings in the third-party service.
Step 1: Start Creating an Access Token in AgilePoint NX
First, create a new access token in AgilePoint NX for Microsoft Dataverse.
How to Start
- There is more than one way to create an access token.
For more information, refer to Access Token for Microsoft Dataverse.
Procedure
- In AgilePoint NX, open the access token configuration screen
for Microsoft Dataverse.
Do not configure the access token credentials.
Keep the access token configuration screen open in AgilePoint NX, but do not save it.
Step 2: Create an App for Microsoft Dataverse
Next, create an app in Microsoft Azure for Microsoft Dataverse.
How to Start
- In a new web browser tab, sign in to Microsoft Azure Portal with a Microsoft 365 Account:
Procedure
- On the Microsoft Azure screen, in the Azure services section, click Azure Active Directory.
- On the navigation pane, in the Manage section, click App registrations.
- On the App registrations screen, click New Registration.
- On the Register an application screen, in the Name field,
enter an app name.
AgilePoint recommends you use an app name associated with your AgilePoint NX app or the way you want to use the app in AgilePoint NX.
- On the Supported account types section select the value that is associated with your Microsoft Dataverse account type.
- Click Register.
The AgilePoint NX Sales Invoice App screen shows the Application (client) ID.
Step 3: Copy the Application ID from the Microsoft Dataverse App
Next, copy the application ID from the Microsoft Dataverse app in Microsoft Azure to your AgilePoint NX access token.
How to Start
- In one web browser tab,
on the App registrations section, open the app you created for Microsoft Dataverse in Microsoft Azure.
For more information, refer to Create an App for Microsoft Dataverse.
- In a different web browser tab, in AgilePoint NX, open the Microsoft Dataverse access token configuration screen.
Procedure
- In Microsoft Azure, to copy the application (client) ID, on the AgilePoint NX Sale Invoice App screen, hover your cursor over the Application (client) ID field, and click Copy to clipboard.
- In AgilePoint NX, on the Microsoft Dataverse Access Token Configuration screen, in the Application ID field, paste the Application (client) ID value from Microsoft Azure.
Step 4: Configure the Reply URL in the Microsoft Dataverse App
Next, configure the Reply URL in the Microsoft Dataverse app that connects to your AgilePoint NX app.
How to Start
- In one web browser tab, in AgilePoint NX, open the Microsoft Dataverse access token configuration screen.
- In a different web browser tab,
open the Microsoft Dataverse app configuration screen.
For more information, refer to Copy the Application ID from the Microsoft Dataverse App.
Procedure
- In AgilePoint NX, on the Microsoft Dataverse Access Token Configuration screen, in the Reply URL field, copy the value.
This is an example value. In a production environment, copy the actual Reply URL from AgilePoint NX.
- In Microsoft Azure, on the AgilePoint NX Sales Invoice App screen, in the Manage section, click Authentication.
- On the Authentication screen, in the Platform configurations section, click Add a platform.
- On the Configure platforms screen, in the Web applications section, select your web application type.
For AgilePoint NX apps, this value will often be Web, but it depends how your app is used.
For more information, refer to the Microsoft Dataverse documentation in Third-Party Vendor Documentation.
- On the Configure Web screen, in the Redirect URIs field, paste the Reply URL value from AgilePoint NX.
- Click Configure.
The Authentication screen shows the Redirect URI.
Step 5: Configure the Client Secret for the Microsoft Dataverse App
Next, configure the client secret for your Microsoft Dataverse app.
How to Start
- In Microsoft Azure, on the App registrations section, open the app you created for Microsoft Dataverse in Microsoft Azure.
For more information, refer to Create an App in Microsoft Dataverse.
Procedure
- On the AgilePoint NX Sales Invoice App screen, in the Manage section, click Certificates & secrets.
- On the Certificates & secrets screen, click New client secret.
- On the Add a client secret screen, in the Description field, enter the description for your client secret.
- In the Expires field, select Never.
- Click Add.
The Certificates & secrets screen shows the client secret.
Step 6: Copy the Client Secret from the Microsoft Dataverse App
Next, copy the client secret from the Microsoft Dataverse app to your AgilePoint NX access token.
How to Start
- In one web browser tab,
in Microsoft Azure, open the Certificates & secrets screen where you created the client secret.
For more information, refer to Configure the Client Secret for the Microsoft Dataverse App.
- In a different web browser tab, in AgilePoint NX, open the Microsoft Dataverse access token configuration screen.
Procedure
- In Microsoft Azure, on the Certificates & secrets screen, in the Client secrets section, hover your cursor over the value associated with the client secret for your app, and click Copy to clipboard.
- In AgilePoint NX, on the Microsoft Dataverse Access Token Configuration screen, in the Key field, paste the Client Secret value from Microsoft Azure.
Step 7: Configure the Permissions for the Microsoft Dataverse App
Next, configure the API permissions for your Microsoft Dataverse app.
How to Start
- In Microsoft Azure, on the App registrations section, open the app you created for Microsoft Dataverse in Microsoft Azure.
For more information, refer to Create an App in Microsoft Dataverse.
Procedure
- On the AgilePoint NX Sales Invoice App screen, in the Manage section, click API permissions.
- On the API permissions screen, in the Configured permissions section, click Add a permission.
- On the Request API permissions screen, in the Microsoft APIs tab, click Dynamics CRM.
- In the Dynamics CRM section, select user_impersonation.
- Click Add permissions.
- On the API permissions screen, click Grant admin consent for AP.
- Click Yes.
The API permissions screen shows the Dynamics CRM permission.
Step 8: Create an Environment for Microsoft Dataverse App
Next, create an environment for Microsoft Dataverse app in Power Apps.
How to Start
- In a new web browser tab, sign in to Microsoft 365 account:
Procedure
- On the Microsoft 365 screen, in the left pane, click Power Apps.
The Power Apps screen opens in a new tab.
- On the Power Apps screen, in the left pane, click Solutions.
- On the Solutions screen, click Create a new environment.
- On the New environment screen, in the Environment name field, enter an environment name.
AgilePoint recommends you use an environment name associated with your AgilePoint NX app or the way you want to use the environment in AgilePoint NX.
- In the Region field, select your region.
This example uses United States. In a production environment, you can select your region.
- In the Environment type field, select the type of environment.
This example uses trial environment. If you have the subscription based account, select Production.
- Click Create Environment.
- Click Close.
The Power Apps screen shows the Sales environment.
Step 9: Copy the Organization URI from Power Apps
Next, copy the organization URI from Power Apps to your AgilePoint NX access token.
How to Start
- In one web browser tab, in Power Apps,
open the environment you created for the Microsoft Dataverse app.
For more information, refer to Create an Environment for Microsoft Dataverse App.
- In a different web browser tab, in AgilePoint NX, open the Microsoft Dataverse access token configuration screen.
Procedure
- In Power Apps, click Settings > Advanced Settings.
The Dynamics 365 screen opens in a new tab.
- On the Dynamics 365 screen, in the URL field in your web browser, copy the organization URI.
This is an example value. In a production environment, copy the actual organization URI from Dynamics 365.
- In AgilePoint NX, on the Microsoft Dataverse Access Token Configuration screen, in the Organization URI field, paste the organization URI value from Dynamics 365.
Step 10: Complete the AgilePoint NX Access Token
Next, complete the AgilePoint NX access token configuration for Microsoft Dataverse.
How to Start
- In AgilePoint NX, open the Microsoft Dataverse access token configuration screen.
Procedure
- In AgilePoint NX, on the Microsoft Dataverse Access Token Configuration screen, in the Token Name field, enter a name for the access token.
- Click Get OAuth2 Access Token.
If you are not signed in to Microsoft Azure, the Microsoft Azure sign in screen opens in a new tab or window in your web browser. Sign in to Microsoft Azure with Microsoft account credentials. The new tab or window closes in your web browser.
The Microsoft Dataverse access token screen shows the OAuth 2.0 access token in the OAuth 2.0 Access Token field.
- Click Done.