D365 F&O to Azure Logic Apps: Export DMF Batch Data API Files from Blob Storage Queue (Deque) for Automated Integrations Microsoft D365 F&O

D365 F&O to Azure Logic Apps: Export DMF Batch Data API Files from Blob Storage Queue (Deque) for Automated Integrations

Prerequistes
Prerequisites are to create 1 azure app registration and azure blob container and of course in DMF - Recurring data job export ( Batch Data API ) setup.

Step - 1 : Add Recurrence
rBVO1LgpT9pJh37M23DRTvMU7zazsG7qnL1bfKmy.png
Step - 2 : Add a HTTP connector with URI of d365 fno deque API and all authentication details from azure app registration. Use GET method.
N2gZLge3VAuLms4L4h8SMG5GIbcdtTUAUJy0jd8Y.pngk32ptBCsmJQS9cbfhwksaNDwFoXH0yfcT7wlaowB.png

Step - 3 : Add another HTTP connector. Add all authentication details again with download location on URI. Use GET method.
chDciB3O8m2VlScVytyQQwiEpdRHQUUSWNmUNf4h.png
TpUE4q7Okyi2RAJvgeWRavAljEVTdkqBnNiQZKpR.png

Step - 4 : Add Create Blob (V2) connector add 2nd HTTP conector's body and blob name as zip file.

K9OzvNuUnussXpz69kD6iXyUS3r1FGQKAqH0dWjJ.png
* Use this below string format for blob name.
RzS63rGv2ZYr3RgvvWLGKcwJB76emKUQw7hOca76.png

FULL XML (Code View):
{

    "definition": {

        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",

        "contentVersion": "1.0.0.0",

        "triggers": {

            "Recurrence": {

                "recurrence": {

                    "interval": 1,

                    "frequency": "Day"

                },

                "evaluatedRecurrence": {

                    "interval": 1,

                    "frequency": "Day"

                },

                "type": "Recurrence"

            }

        },

        "actions": {

            "HTTP": {

                "runAfter": {},

                "type": "Http",

                "inputs": {

                    "uri": "https://ax0crp0dev1.operations.dynamics.com/api/connector/dequeue/DB2AF038-A667-4640-AD76-820C48504113",

                    "method": "GET",

                    "authentication": {

                        "type": "ActiveDirectoryOAuth",

                        "tenant": "@{parameters('TenantId')}",

                        "audience": "@{parameters('Dyn365foURL')}",

                        "clientId": "@{parameters('Dyn365fOClientId')}",

                        "secret": "@{parameters('SecretId')}"

                    }

                },

                "runtimeConfiguration": {

                    "contentTransfer": {

                        "transferMode": "Chunked"

                    }

                }

            },

            "Create_blob_(V2)": {

                "runAfter": {

                    "HTTP-copy": [

                        "Succeeded"

                    ]

                },

                "type": "ApiConnection",

                "inputs": {

                    "host": {

                        "connection": {

                            "name": "@parameters('$connections')['azureblob']['connectionId']"

                        }

                    },

                    "method": "post",

                    "body": "@body('HTTP-copy')",

                    "headers": {

                        "ReadFileMetadataFromServer": true

                    },

                    "path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('AccountNameFromSettings'))}/files",

                    "queries": {

                        "folderPath": "/container101",

                        "name": "@concat('vendorExport2','.zip')",

                        "queryParametersSingleEncoded": true

                    }

                },

                "runtimeConfiguration": {

                    "contentTransfer": {

                        "transferMode": "Chunked"

                    }

                }

            },

            "HTTP-copy": {

                "runAfter": {

                    "HTTP": [

                        "Succeeded"

                    ]

                },

                "type": "Http",

                "inputs": {

                    "uri": "@body('HTTP')?['DownloadLocation']",

                    "method": "GET",

                    "authentication": {

                        "type": "ActiveDirectoryOAuth",

                        "tenant": "@{parameters('TenantId')}",

                        "audience": "@{parameters('Dyn365foURL')}",

                        "clientId": "@{parameters('Dyn365fOClientId')}",

                        "secret": "@{parameters('SecretId')}"

                    }

                },

                "runtimeConfiguration": {

                    "contentTransfer": {

                        "transferMode": "Chunked"

                    }

                }

            }

        },

        "outputs": {},

        "parameters": {

            "Dyn365fOClientId": {

                "defaultValue": " 797e9002-d20b-4980-8964-b3daaf17e565",

                "type": "String"

            },

            "Dyn365foURL": {

                "defaultValue": "https://ax0crp0dev1.operations.dynamics.com/",

                "type": "String"

            },

            "processQueueName": {

                "defaultValue": "LogicApps101",

                "type": "String"

            },

            "ExportJobId": {

                "defaultValue": "DB2AF038-A667-4640-AD76-820C48504113",

                "type": "String"

            },

            "ContainerName": {

                "defaultValue": "container101",

                "type": "String"

            },

            "TenantId": {

                "defaultValue": "ec5106cd-7ef3-4f82-a502-94d3bf85877b",

                "type": "String"

            },

            "SecretId": {

                "defaultValue": "Che8Q~j2BEz_yTkoA551L0pxna.64EmUyrODVaLC",

                "type": "String"

            },

            "$connections": {

                "type": "Object",

                "defaultValue": {}

            }

        }

    },

    "parameters": {

        "$connections": {

            "type": "Object",

            "value": {

                "azureblob": {

                    "id": "/subscriptions/ea754aa9-0abb-4795-bfc6-d2b25cac94cc/providers/Microsoft.Web/locations/centralindia/managedApis/azureblob",

                    "connectionId": "/subscriptions/ea754aa9-0abb-4795-bfc6-d2b25cac94cc/resourceGroups/D365FNO-DEV2/providers/Microsoft.Web/connections/azureblob",

                    "connectionName": "azureblob",

                    "connectionProperties": {}

                }

            }

        }

    }

}

Previous Article
SPF, DKIM, and DMARC Explained: Complete Email Authentication Gui...

Comments (0)

No comments yet. Be the first to leave one!