Create an Entra App for BC Integration

Create an Entra App for BC Integration

How to create an Entra App Registration in Azure

   trigger OnDelete()
  var
      PaymentTermsTranslation: Record "Payment Term Translation";
  begin
      PaymentTermsTranslation.SetRange("Payment Term", Code);
      PaymentTermsTranslation.DeleteAll();
  end;

Creating an App Registration in Azure for Business Central

This post shows how to create an App Registration in Azure, allowing third-party systems to connect to Business Central (BC) APIs securely. It acts as an identity in BC and enables the use of OAuth 2.0 authentication protocols required by BC online.

A Few Key Concepts

Application Id (aka Client ID)

This is a unique identifier assigned to the app. It is registered in BC as the ‘identity’, and permissions are assigned to it, similar to a user’s permissions.

Tenant ID

The Azure tenant ID where the app is registered.

Redirect URI

This is where the authentication responses are sent:

BC Online
  • https://businesscentral.dynamics.com/OAuthLanding.htm
BC On Premise (some examples)
  • https://localhost/BC250/OAuthLanding.htm
  • https://MyServer/BC250/OAuthLanding.htm
  • https://{your server}/{your environment}/OAuthLanding.htm

Client Secret

The secret is generated and shared with the third-party system. It is used to prove identity when requesting an authentication token. These secrets are time-limited, and a new one must be generated and shared when the current one expires.

INFO

Client secrets are displayed only once, upon creation. If lost, a new one must be generated.

API Permissions

These define the API access an Entra app will have. They are configured in Azure and are unrelated to BC permissions. Examples include access to the Admin API in Business Central or Microsoft Graph API to read a user’s email address.

Delegated Permissions vs Application Permissions

When adding API permissions for Business Central, you must choose between Delegated and Application permissions. Generally, an app will need one or the other, depending on its specific purpose.

Delegated Permissions

Delegated permissions are used when the app acts on behalf of a signed-in user. These permissions require user authentication, meaning the user must log in. The app can only access Business Central based on that user’s permissions.

Application Permissions

Application permissions allow access to Business Central without a signed-in user. They are typically used for background services, automation, or system-to-system (S2S) integrations. The app receives full access based on assigned permissions.

Comparison Table

FeatureDelegated PermissionsApplication Permissions
User Sign-in Required?✅ Yes❌ No
Follows User Permissions?✅ Yes❌ No (App has its own BC permissions)
Best for?Interactive user-based applicationsBackground processes, system-to-system integration
Example Use CasePower Automate flow running as a userAutomated data sync between BC and another system
Authentication TypeOAuth 2.0 (User login required)OAuth 2.0 Client Credentials (No user login)
Requires Admin Consent?SometimesAlways

How to Register a New App for Business Central

  1. Go to Azure Portal.

  2. Navigate to Azure Active Directory → App registrations.

VAT Posting Setup in BC
  1. Click + New registration. Give the app a name and choose the account type.
VAT Posting Setup in BC
  1. Select Web (this can also be done later in Authentication settings).
VAT Posting Setup in BC
  1. Enter the redirect URI: https://businesscentral.dynamics.com/OAuthLanding.htm Click Register to continue.

  2. Now we need to select the API permissions required for the app. Go to API Permissions and Add A Permission

VAT Posting Setup in BC
  1. From the options, select Dynamics 365 Business Central
VAT Posting Setup in BC
  1. For Delegated Permissions, add the required permissions.
VAT Posting Setup in BC
  1. For Application Permissions, select and choose the necessary permissions.
VAT Posting Setup in BC
  1. If required, grant admin consent (admin access required).
VAT Posting Setup in BC
  1. Select Yes, then confirm the status is granted.
VAT Posting Setup in BC
  1. Add a client secret for S2S access, o to Certificates & Secrets then click New Secret.
VAT Posting Setup in BC
  1. Give the secret a name and set an expiration duration. Click Add.
VAT Posting Setup in BC
  1. This will generate a secret (the Value column). This is the only time you will be able to view this so make a note of it, securely.
VAT Posting Setup in BC
  1. The three pieces of information you generally need are
    • Application (client) ID – Found on the app registration overview page.
    • Client Secret – Obtained in the previous step.
    • Directory (tenant) ID – Found on the app registration overview page.

CAUTION

Important: If a client secret is compromised, remove it immediately and generate a new one.

Configuring the Entra App in Business Central

  1. Navigate to Microsoft Entra Applications.
VAT Posting Setup in BC
  1. Create a new Entra Application.
VAT Posting Setup in BC
  1. Add the client ID from the Entra App and Grant Consent.
VAT Posting Setup in BC
  1. Sign in as an admin and accept the requested permissions.
VAT Posting Setup in BC
  1. Change the state to Enabled. A prompt will ask if you want to create a user with the app’s name. Select Yes to continue.
VAT Posting Setup in BC
  1. Assign permission sets to the S2S user as required.
    • Note: It is not possible to assign SUPER permissions to an S2S user in Business Central.
VAT Posting Setup in BC

That’s it! Now configure the third-party application with the client secret or, if testing APIs, configure Postman.

Back to all posts