Data Package: Data Package is a simple .zip file that contains the source (import) or target data(export) itself . The zip file contains three files. The data file and the manifest files which contain metadata information of the Data Entity and the processing instructions for DMF.
The integration involves the following steps
- Enable change tracking
- Creation of the Data Export DMF Project
- Authentication against Azure AD
- Interact with DMF using REST API
- Creation of Logic app to trigger the API
2. Register the AAD application in D365FO
- System administration > Setup > Azure Active Directory applications
- Click “New” -> Enter APP-ID(created as part of the previous step), Meaningful name and User ID (the permission you would like to assign).
- The client application authenticates to the Azure AD token issuance endpoint and requests an access token.
- The Azure AD token issuance endpoint issues the access token.
- The access token is used to authenticate to the D365FO DMF and initiate DMF Job.
- Data from the DMF is returned to the third-party application.
Http Method: POST Request URL: https://login.microsoftonline.com//oauth2/token Parameters : grant_type: client_credentials [Specifies the requested grant type. In a Client Credentials Grant flow, the value must be client_credentials.] client_id: Registered App ID of the AAD Application client_secret: Enter a key of the registered application in AAD. Resource: Enter the URL of the D365FO Url (e.g. https://dev-d365-fo-ultdeabc5b35da4fe25devaos.clou
The high level interaction of API calls to get the delta package via REST API is shown below.
7. Now lets go through the Each step.
>>> in the step we are taking the variables called execution id and file name to store the values in further steps
8. Now lets take a Scope and add the HTTP trigger to call the ExportToPackage URL as Follows.
POST /data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.ExportToPackage
BODY
{
"definitionGroupId":"<Data project name>",
"packageName":"<Name to use for downloaded file.>",
"executionId":"<Execution Id if it is a rerun>",
"reExecute":<bool>,
"legalEntityId":"<Legal entity Id>"
}
It looks like below in Logic app
9. Note that the authentication will follows in below way in Logic app.
10. Now lets take a Do Until condition and call the execution status API to get the status. Auth will be Same as above API.
11. Take the True False condition to validate the status in above step.
15. So with the simple steps above we can export the data outside the D365 using DMF DataPackage APIs. I will explain the Function app creation and Publish part in my upcoming blogs.
Thank you !!












No comments:
Post a Comment