Application Configuration in Microsoft Azure Portal for OAuth2 Account to use in Business Central

Overview

Snaps in the Microsoft Dynamics 365 Business Central Snap Pack require an Access Token or OAuth2 account to access resources in Azure. For the accounts to authorize successfully, create and configure an application in the Azure Portal as described in this topic.

Prerequisites

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

Key Steps in the Workflow

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.
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. The details of the registered application display in the search list.

Define Permissions

The Microsoft Dynamics 365 Business Central Snap Pack supports the following account types:

The permissions for the registered application are either Delegated or Application based on the account type.

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

  2. On the Request API permissions window, select Microsoft Graph > Dynamics 365 Business Central.
    Add permissions for Dynamics 365 Business Central

  3. Select Delegated Permissions or Application Permissions.
    Select Delegated or Application permissions

  4. Select the permissions you require.
    Select the required permissions

  5. Click Add Permissions. You can view all the permissions added under Configured permissions.
    Configured permissions in Azure Portal

  6. Click Overview and select Add a Redirect URI. You are redirected to the Platform configurations page.
    Add a Redirect URI in Azure Portal

    1. Under Platform configurations, click Add a platform.
      Add a platform in Azure Portal

    2. Select Web and specify the Redirect URI in the following format:
      https://<control-plane-name>.snaplogic.com/api/1/rest/admin/oauth2callback/businesscentral
      where <control-plane-name> corresponds to the domain part of your SnapLogic environment URL, for example, elastic (global control plane) or emea (EMEA control plane).
    3. Click Configure. A popup message indicates that the application is successfully updated.
  7. On the Platform configurations page, click Save. The Redirect URIs are added to the application.

Configure the Business Central Application

  1. Log in to the Microsoft Business Central application.
  2. Search for aad in the search box.
    Search for aad in Business Central

  3. Navigate to Azure Active Directory Application and select New.
  4. Configure the following fields for the new record:
    1. In the Client ID field, specify the client ID generated from the registered application in Azure Active Directory.
      Specify Client ID in Business Central application

    2. In the Description field, specify a name for the application.
    3. Change the State to Enabled.
      Change State to Enabled in Business Central application

    4. In the User Permission Sets, select the ellipsis (...) and select the required Permission Set.
      Select User Permission Sets in Business Central

    5. Click Grant Consent to provide permission to access the Business Central data.
      Grant consent in Business Central application

Specify the Credentials and Validate the Snap Account

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

  • Instance URL
  • Application (client) ID
  • Client secret value
  1. Navigate to the Business Central Snap of your choice and configure the Business Central OAuth2 Account with the details from the registered application.
    Configure Business Central OAuth2 Account with registered application credentials

  2. Click Authorize. You are redirected to the sign-in page of the Azure Portal.
  3. Sign in to the Azure Portal with valid credentials. You are redirected to the Snap Edit account settings dialog. The Access and Refresh tokens are auto-populated and encrypted in the Account settings.

Troubleshooting

Error Reason Resolution
Error 401 The pipeline could not complete execution because of a connection error. Reauthorize the account and retry.