Application Configuration in Azure Portal for OAuth2 Account

Configure an application in the Microsoft Azure Portal to authorize the Dynamics 365 OAuth2 Account for Online in SnapLogic.

Overview

Microsoft Dynamics 365 for Sales Snaps require an OAuth2 account to access the Azure resources. For the OAuth2 account to be authorized successfully, create and configure an application corresponding to the account as shown in the workflow.


Azure Portal OAuth2 account configuration workflow

Note: You must complete steps 1 and 2 in the Azure Portal and the remaining steps in the Snap Account (SnapLogic Platform).

Prerequisites

An Azure account with a free subscription to create the application.

Create an Application in the Azure Portal

  1. Log in to the Microsoft Azure Portal.
  2. Navigate to Azure services > Microsoft Entra ID.
  3. Navigate to Add > App registration.
  4. On the Register an application page, specify the name for registering the application and click Register. Learn more about creating an application at Quickstart: Register an app in the Microsoft identity platform - Microsoft Entra.
Note: To use an existing application, navigate to Portal Home > Azure Active Directory > App registrations > All applications. In the search box, specify the application name you want to use. Details on the application display in the search list.

Define Permissions

  1. On the left navigation panel, navigate to Manage, select API permissions > Add a permission.


    Add a permission in the Azure Portal API permissions panel

  2. On the Request API permissions window, select Microsoft Graph > Application permissions for the OAuth2 Application Account.


    Request API permissions window — Microsoft Graph selection

  3. Select the permissions from Files, Users, and Teams. Choose the minimum API permissions listed under Scopes and Permissions Required for Dynamics 365 for Sales.
  4. Click Add Permissions. View all the permissions added under Configured permissions.


    Request application permission selection


    Configured permissions after adding

  5. Click Grant admin consent confirmation and select Yes.


    Grant admin consent for API permissions

  6. Click Overview and select Add a Redirect URI. You will be redirected to the Platform Configurations page.


    Add a Redirect URI in Azure Portal Overview

    1. Under Platform configurations, click Add a platform.
    2. Select Web and specify either of the following Redirect URIs based on the region your server is located:

      • https://elastic.snaplogic.com/api/1/rest/admin/oauth2callback/rest
      • https://emea.snaplogic.com/api/1/rest/admin/oauth2callback/rest
    3. Click Configure. A popup message displays indicating that the application is successfully updated.


      Application successfully updated confirmation popup

  7. On the Platform configurations page, click Save. The Redirect URIs are added to the application.


    Platform configurations page with saved Redirect URIs

Locate the Application Credentials in the Azure Portal

To authorize your account in SnapLogic, you must have the following application credentials:

  • Application (Client) ID
  • Directory (Tenant) ID
  • Client secret value
  1. On the application page, under Essentials, note the Application (client) ID and Directory (tenant) ID needed for the Snap account.


    Application (client) ID and Directory (tenant) ID in Azure Portal Essentials

  2. In the left navigation panel, select Manage > Certificates & secrets.
  3. On the Certificates & secrets page, click + New client secret.
  4. In the Add a client secret window, enter the Description, select an option for Expires from the dropdown list, and click Add. The Client secret value and ID are generated. This value and the ID are required to configure the OAuth2 account.


    Client secret value and ID after generation

    Important: You can copy the Client secret value only after it is generated. This value is displayed only once, so copy it securely.

Scopes and Permissions Required for Dynamics 365 for Sales

Application permissions
Permission Display String Description Admin Consent Required?
user.impersonation user_impersonation Allows you to temporarily sign in as a different user in your network. No
User.Read.All User.Read.All Allows the app to read the full set of profile properties, reports, and managers of other users in your organization, on behalf of the signed-in user. Yes

Specify the Credentials and Validate the Snap Account

  1. Navigate to the Snap of your choice and configure the OAuth2 account with the details from the Azure portal's registered application. Refer to Dynamics 365 OAuth2 Account for Online.
  2. Select the Auto-refresh token checkbox in the account settings and click Apply.
  3. Click Authorize. The Access and Refresh tokens are generated. You will be redirected to the sign-in page of the Azure Portal.
  4. Sign in to Azure Portal with valid credentials to redirect to the Snap Edit account settings dialog. The Access and Refresh tokens are autopopulated but encrypted in the Account settings.
  5. Validate the Snap Account.
Important: If you select the Auto-refresh token checkbox, then you must provide offline_access as the Scope in the Token endpoint configuration.

Troubleshooting

Common Errors Reason Response
Error 401 Token is invalid Provide a valid token and reauthorize the account.
The redirect URI specified does not match the reply URI configured for the application. Incorrect redirect URI specified by user. Add the following redirect URI: https://elastic.snaplogic.com/api/1/rest/admin/oauth2callback/rest
URL error when invoking the operation Ensure the tenant domain name is correct. Ensure that the Directory (tenant) ID noted from the application is in the correct format. Example: 2060aafa-89d9-423d-9514-eac46338ec05

Frequently Asked Questions