(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.
  • Some information about third-party integrations is outside the scope of the AgilePoint NX Product Documentation. It is the responsibility of the vendors who create and maintain these technologies to provide this information. This includes specific business use cases and examples; explanations for third-party concepts; details about the data models and input and output data formats for third-party technologies; and various types of IDs, URL patterns, connection string formats, or other technical information that is specific to the third-party technologies. For more information, refer to Where Can I Find Information and Examples for Third-Party Integrations?

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

Procedure

  1. In AgilePoint NX, open the access token configuration screen for Microsoft Dataverse.

    Common Data Service Global Access Token screen

    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

  1. In a new web browser tab, sign in to Microsoft Azure Portal with a Microsoft 365 Account:

Procedure

  1. On the Microsoft Azure screen, in the Azure services section, click Azure Active Directory.

    Microsoft Azure screen
  2. On the navigation pane, in the Manage section, click App registrations.

    Overview screen
  3. On the App registrations screen, click New Registration.

    App registrations screen
  4. 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.


    Register an application screen
  5. On the Supported account types section select the value that is associated with your Microsoft Dataverse account type.

    Register an application screen
  6. Click Register.

    Register an application screen

    The AgilePoint NX Sales Invoice App screen shows the Application (client) ID.


    AgilePoint NX Sales Invoice screen

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

  1. 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.

  2. In a different web browser tab, in AgilePoint NX, open the Microsoft Dataverse access token configuration screen.

Procedure

  1. 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.

    AgilePoint NX Sales Invoice screen
  2. 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.

    Common Data Service Access Token screen

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

  1. In one web browser tab, in AgilePoint NX, open the Microsoft Dataverse access token configuration screen.
  2. 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

  1. 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.


    Common Data Service Access Token screen
  2. In Microsoft Azure, on the AgilePoint NX Sales Invoice App screen, in the Manage section, click Authentication.

    AgilePoint NX Sales Invoice App screen
  3. On the Authentication screen, in the Platform configurations section, click Add a platform.

    Click Add Platform
  4. 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.


    Configure Platforms screen
  5. On the Configure Web screen, in the Redirect URIs field, paste the Reply URL value from AgilePoint NX.

    Configure Web screen
  6. Click Configure.

    Click Configure

    The Authentication screen shows the Redirect URI.


    AgilePoint NX Sales Invoice screen

Step 5: Configure the Client Secret for the Microsoft Dataverse App

Next, configure the client secret for your Microsoft Dataverse app.

How to Start

  1. 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

  1. On the AgilePoint NX Sales Invoice App screen, in the Manage section, click Certificates & secrets.

    Click Certificates Secrets
  2. On the Certificates & secrets screen, click New client secret.

    Certificates Secrets screen
  3. On the Add a client secret screen, in the Description field, enter the description for your client secret.

    Add a Client Secret screen
  4. In the Expires field, select Never.

    Select Never
  5. Click Add.

    Click Add

    The Certificates & secrets screen shows the client secret.


    Shows 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

  1. 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.

  2. In a different web browser tab, in AgilePoint NX, open the Microsoft Dataverse access token configuration screen.

Procedure

  1. 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.

    Copy Client Secret
  2. In AgilePoint NX, on the Microsoft Dataverse Access Token Configuration screen, in the Key field, paste the Client Secret value from Microsoft Azure.

    OneDrive Access Token screen

Step 7: Configure the Permissions for the Microsoft Dataverse App

Next, configure the API permissions for your Microsoft Dataverse app.

How to Start

  1. 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

  1. On the AgilePoint NX Sales Invoice App screen, in the Manage section, click API permissions.

    Click API Permissions
  2. On the API permissions screen, in the Configured permissions section, click Add a permission.

    Add Permission
  3. On the Request API permissions screen, in the Microsoft APIs tab, click Dynamics CRM.

    Click Dynamics CRM
  4. In the Dynamics CRM section, select user_impersonation.

    Select User Impersonation
  5. Click Add permissions.

    Add Permissions
  6. On the API permissions screen, click Grant admin consent for AP.

    Grant Admin Consent For AP
  7. Click Yes.

    Click Yes

    The API permissions screen shows the Dynamics CRM permission.


    Added Dynamics Crm Permissions

Step 8: Create an Environment for Microsoft Dataverse App

Next, create an environment for Microsoft Dataverse app in Power Apps.

How to Start

  1. In a new web browser tab, sign in to Microsoft 365 account:

Procedure

  1. On the Microsoft 365 screen, in the left pane, click Power Apps.

    Click Power Apps

    The Power Apps screen opens in a new tab.

  2. On the Power Apps screen, in the left pane, click Solutions.

    Click Solutions
  3. On the Solutions screen, click Create a new environment.

    Create New Environment
  4. 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.


    Create New Environment
  5. In the Region field, select your region.

    This example uses United States. In a production environment, you can select your region.


    Select Region
  6. In the Environment type field, select the type of environment.

    This example uses trial environment. If you have the subscription based account, select Production.


    Select Environment Type
  7. Click Create Environment.

    Create Environment
  8. Click Close.

    Create Close

    The Power Apps screen shows the Sales environment.


    Power Apps screen

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

  1. 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.

  2. In a different web browser tab, in AgilePoint NX, open the Microsoft Dataverse access token configuration screen.

Procedure

  1. In Power Apps, click Settings > Advanced Settings.

    Click Advanced Settings

    The Dynamics 365 screen opens in a new tab.

  2. 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.


    Copy Organization URI
  3. In AgilePoint NX, on the Microsoft Dataverse Access Token Configuration screen, in the Organization URI field, paste the organization URI value from Dynamics 365.

    Common Data Service Access Token screen

Step 10: Complete the AgilePoint NX Access Token

Next, complete the AgilePoint NX access token configuration for Microsoft Dataverse.

How to Start

  1. In AgilePoint NX, open the Microsoft Dataverse access token configuration screen.

Procedure

  1. In AgilePoint NX, on the Microsoft Dataverse Access Token Configuration screen, in the Token Name field, enter a name for the access token.

    Common Data Service Access Token screen
  2. Click Get OAuth2 Access Token.

    OneDrive Access Token screen

    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.


    Microsoft Sign In screen

    The Microsoft Dataverse access token screen shows the OAuth 2.0 access token in the OAuth 2.0 Access Token field.


    OneDrive Access Token screen
  3. Click Done.

    Common Data Service Access Token screen