Logic Apps in Dynamics 365 F&O File Based Data Integrations
This article is intended to provide a high-level overview of how to use Logic Apps as an alternative option for file-based data integration of Dynamics 365 Finance and Operations (D365 F&O).
The scenario is: how to import data into D365 F&O using Logic Apps from a file located in Microsoft OneDrive.
The main components of this sample scenario are:
- Microsoft OneDrive
- Logic Apps
- Dynamics 365 F&O
- Office 365 (Outlook)
- Data Management Framework (DMF) Data Package
Connectors are the APIs. We can consume the connectors to establish communication between different systems (even cross-platforms) and trigger a set of functions offered by the API. There are hundreds of connectors available on the market. Many of them are free, and others are not. In this scenario, we are using free of charge connectors provided by Microsoft.
DMF Data Package is the standard data package that can be created by using any Data Entity of D365 F&O. The proper data package is one of the prerequisites of this scenario to provide the data in this format. It is a classic .zip file. If you have questions about DMF and Data Package, please read the Summary of Integrations in Dynamics 365 for Finance and Operations blog article. Alternatively, send us your question through our Contact Form and we would be more than happy to assist.
Logic Apps are an Azure-hosted (cloud-hosted) service provided by Microsoft located within the Azure Portal. To work with Logic Apps, you have to sign-up for a subscription. There is a basic free subscription with a minimum service level; we are using the free subscription in this scenario and it works perfectly. There is also a higher level subscription and depending on the level, Microsoft provides more options for error handling and to monitor the solution.
What does Logic Apps do? Using Logic Apps designer in Azure Portal, we can create a logical sequence of the Connectors (APIs) and as a result, we can create a business flow. When Logic Apps executes the logic and calls the Connectors in the sequence, our flow is going to be executed. In our specific scenario, the data file gets processed and the data is imported to D365 F&O. Alternatively, we can create the entire solution in Microsoft Visual Studio, then import it to our newly created Logic Apps solution through the Azure Portal.
- Azure Account (create a free one).
- Integration Account (free). It is not necessary if you have a paid Azure plan.
- OneDrive with a specific folder structure (described later in the article).
- Dynamics 365 Finance and Operations.
- Office 365 (Outlook) account for receiving the notification emails.
- Outlook 365 connector.
- OneDrive connector.
- D365 F&O connector.
The Business Flow
- Scan OneDrive’s input folder.
- Move the data file to OneDrive’s Processing folder.
- Upload the data file to Azure Blob storage.
- Trigger the data import process in D365 F&O.
- Monitor the import process status.
- If data import is succeeded, move the data file from OneDrive’s Processing folder to the Success folder.
- If data import is failed, move the data file from OneDrive’s Processing folder to the Error folder and send an email alert to the desired recipient.
Now, let’s go through the high-level steps of the solution.
Create the Data Package
As a first step, we need to create the data package. It should be something similar to the .zip file in the screenshot below. At this point, do not copy the file to the Input folder (see the next step).
The beauty of using the DMF Data packages is you can import and export any data which data based on the published D365 F&O Data Entities. No additional processing logic development is needed. If the data file, the data package is based on a Data Entity, the DMF of D365 F&O can process the data in both import and export direction automatically.
Create the OneDrive Folder Structure
This folder structure was created as an example specifically for this demonstration. The final folder structure must be added as a parameter to the OneDrive connector as the parameters of the file moving operations steps.
Find the Connectors
The list of connectors with full details can be found on the Connectors Overview page on the Microsoft site.
Create the Azure Integration Account
The function to create the Integration Account is in Azure Portal’s Integration page. Click on the ‘integration accounts’ function and follow the on-screen instructions and steps.
Create the Logic Apps Solution and Configure the Solution
The function to create the Logic Apps solution is located under the same Integration page.
1. Create the solution. In our case, the name is “OneDrive2D365FO”.
2. Configure the Integration account if necessary.
3. Add and configure the connectors.
Once the configuration steps are complete, the solution should look something like the screenshot below. Make sure to authorize the connections, all three one-by-one; otherwise they won’t work.
Then we can create our logic and flow in the Logic Apps Designer or by clicking on the Edit menu button on the Overview page.
Once we finish the design, the solution should look something similar in the Designer. Save it.
To start the logic, click on the Run menu button (the hand symbol cursor is pointing to it in the screenshot above).
Once the logic runs, we only need to copy the data file, the .zip file into the Input folder in OneDrive. Logic Apps monitors that folder, and once the file is dropped into the Input folder, the import process is triggered. The processing time depends on the volume of the data. Depending on the result of the import to D365 F&O, the data file will be moved either to Success or Error folder in OneDrive. If the data processing was successful, you should see the imported data in D365 F&O.
You can create a D365 F&O to OneDrive export in a very similar way.
In summary, Logic Apps and the Connectors can be an easy way to create basic, file-based data import and export solutions for D365 F&O integrations.
I did not go into configuration details in this blog post. The configuration steps and a sample solution can be found in the article File based integration using Logic Apps on GitHub.
If you have any questions or want to learn more, please contact us and a member of our D365 F&O Team will be happy to assist and demo the working solution.
We specialize in providing technical assessments, break-fix support, optimization services, and solution expansion projects for Dynamics 365 for Finance and Operations.