Menu Close

D365FO On-premise Integration

the integration way for the on-premise environment is different from cloud environment,

For Cloud environment or OneBox we create application registration on Azure and enter the application Id in Azure Application in D365FO app.

For On-Premise environment we use ADFS to generate application and secret and register application Id in D365FO application.

Also still there are some difference in calling token api we will discuss later in this blog:

Step 1:

Navigate to ADFS server and open “Microsoft Dynamics 365 for Operations On-premises” from Application Group

ADFS Application Group

Step 2:

click on Add Application and Name the application as describe your API if custom service or OData as below screenshoot

Adding ADFS Application

Step 3:

Select Server Application and click Next

ADFS Server Application

Step 4:

Copy generated Client Identifier (Application Id)

Enter Application URL without “/namespaces/AXSF”

ADFS Application Id

Step 5:

Copy Secret code in safe area as it will not appear again and only way if you lost it to generate new secret

ADFS Secret

Step 6:

Authorize the new server application to use the Web API and request OpenID connection authorizations.

ADFS Application WEB API Authorization

Step 7:

After complete this setup, its necessary  configure the Azure Active Directory applications

System administration –>  Setup –> Azure Active Directory applications

And use the previously Client ID generated in the ADFS application.

D365FO Azure Active Directory

Step 8:

Postman Configuration

Create a new environment with the following parameters

VariableValue
tenant_idadfs
client_id«CLIENTID GENERATED IN THE ADFS APP»
client_secret«SECRET GENERATED IN ADFS»
resourceYour AOS URL i.e  «https://ax.d365ffo.onprem.contoso.com«
grant_typeclient_credentials

Step 9:

Create new Request to get Token

Postman Token collection

In the body, set the reference to the global variables defined in the environment configuration

KeyValue
tenant_id{{tenant_id}}
client_id{{client_id}}
client_secret{{client_secret}}
resource{{resource}}
grant_type{{grant_type}}

Step 10:

Copy the following script in Test

var json = JSON.parse(responseBody);
tests[«Get Azure AD Token»] = !json.error && responseBody !== » && responseBody !== '{}' && json.access_token !== »;
postman.setEnvironmentVariable(«bearerToken», json.access_token);

To test if everything is ok, you can click on Send and the bearer token is generated

KeyValue
Content-Typeapplication/x-www-form-urlencoded

Step 11:

Test DataEntity

You can get data for any entity, you only need set the following parameter in the Get

TypeOdata URL
Get{{resource}}/namespaces/AXSF/data/CustomersV3?$top=5

Header Parameters

KeyValue
AuthorizationBearer {{bearerToken}}
Content-Typeapplication/json

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.