Monday, March 25, 2024

Send data into D365 FO to call recurring integration via logic apps

Send data into Dynamics 365 FO to call recurring integration via logic apps

1. Register an app in Azure: How to register Azure App for Dynamics 365 FO - Learn from Dynamicscommunity101

This step involves creating a new application registration in the Azure portal. This is a preliminary step required to authenticate and authorize your application to interact with Dynamics 365 Finance & Operations. By registering the app, you obtain an Application ID and a Directory (tenant) ID that is used in subsequent steps to grant access and establish a secure connection.

2. Give access to the Azure app in Dynamics 365: How to add Azure app ref in Dynamics 365 FO - Learn from Dynamicscommunity101

After registering your app in Azure, you need to add the Azure app reference within your Dynamics 365 F&O environment. This involves configuring Dynamics 365 F&O to recognize and authorize the Azure app, typically by specifying the Application ID and setting the necessary permissions, thus allowing the Azure app to interact with Dynamics 365 data and services.

3. Now let's go to the Azure portal: Azure portal - To learn further from Dynamicscommunity101

Navigate to the Azure portal to manage app services and configurations, including the setup for the Logic app. Begin by reviewing the Logic app's architecture, then create a Logic app with a "Recurrence" trigger for automatic execution at set intervals. Compose a JSON message for a Dynamics 365 data entity, configure an HTTP trigger for token acquisition, and parse the received JSON to process data. Finally, use an HTTP action to send the structured data to Dynamics 365 F&O, completing the integration flow.

Before starting with the Logic app, below is an overview of the whole Logic app that we created in our blog of Dynamicscommunity101

Logic App Overview Screenshot

Create a logic app with the trigger as Recurrence. You may choose as per your requirements.

Logic App Trigger

Now create a JSON to be sent to the respective Dynamics 365 data entity. In my case, it is a custom data entity.

Logic App Compose

Now we will hit the Microsoft URL to get the access token as shown below.

Logic App HTTP trigger

Now the output of the above action will be parsed using the Parse JSON action as shown below.

Logic App parse JSON

Now we will send the data to Dynamics 365 using HTTP action as shown below.