Set up Dynamics 365 Export to Data Lake
Overview
Setting up Export to Data Lake in Dynamics 365 F&SCM consists of the following steps:
- Configure the Azure Resources
- Install the Export to Data Lake add-in
- Use Serverless Pool as a Source to read data
The References section contains references to the Microsoft documentation on the subjects in this procedure.
Configure the Azure Resources
In this procedure, you will create an application, an ADSL2 storage account, and a key vault, and configure their settings.
- Open Microsoft Entra ID.
- If a Service Principal for Microsoft Dynamics ERP Microservices (0cdb527f-a8d1-4bf8-9436-b352c68682b2) is not installed yet, create one using the Microsoft documentation.
-
Set up an application:
- Create an application.
- Copy the Application ID and save it for later.
- Select API Permissions
-
Add an API Permission for
Azure Key Vault
- Type : Delegated
- Permission : user_impersonation
- Select Certificates and secrets
- Add a new client secret, and save it for later.
- Create an ADSL2 Storage account. Ensure that Enable hierarchical namespace is selected on the Advanced tab.
-
Grant the Microsoft Entra ID Application IAM Permissions to the Storage Account that was just created:
- Select Access Control (IAM)
- Grant the application that was created in step 3 Storage Blob Data Contributor and Storage Blob Data Reader permissions.
-
Set up a Key Vault:
- Create a Key Vault.
- Select Overview.
- Find the Vault URI and save it for later.
-
Create the following secrets:
- app-id : the id of the application created in step 3.1.
- app-secret : the client secret that was created for the app in step 3.6.
- storage-account-name : the name of the storage account created in step 4.
-
Add an Access Policy to the Key Vault that allows the
Microsoft Dynamics ERP Microservices
service principal to at least the following
Secret Management Operations
:
Get
List
Install the Export to Data Lake add-in
In this procedure, you will install the Data Lake add-in into the Microsoft 365 Dynamics environment, and configure it to export to the ADSL2 storage account.
-
Open the Microsoft Dynamics 365 environment:
- sign into Lifecycle Services.
- Select the Microsoft Dynamics 365 environment.
- Click Full Details in the right-hand pane.
- Set up the Power Platform integration, if not done already.
-
Install the Export to Data Lake add-in:
- Click Install a new add-in
- Select Export to Data Lake The Setup add-in dialog box opens.
-
Select the following configuration values for the add-in:
- Tenant ID : your Microsoft Entra ID tenant ID
- Key Vault DNS : The Vault URI of the Key Vault (see step 6 of the Configure the Azure Resources )
- Storage account secret : your storage-account-name
- Application ID secret : your app-id
- Application Secret secret : your app-secret
- Select Enable near real-time data This is a prerequisite for integrating with Synapse in the next section.
- Click Install The add-in is installed with your selected options.
-
Verify that the add-in was configured successfully:
- sign into the Microsoft Dynamics 365 environment.
- Search for Configure data feeds
- Open the Export to Data Lake page.
- Find and select a sample table (e.g. CustTable) and click Activate Once the Status column displays Running , the storage account should contain a folder for the corresponding table under: dynamics365-financeandoperations/<environment>.sandbox.operations.dynamics.com/Tables.
Integrate with Synapse
In this procedure, you will deploy an Azure Function App to sync the data from the data lake into Synapse.
- Create a Synapse workspace if one does not already exist.
- If the Synapse workspace already existed, explicitly assign the Synapse managed identity the Storage Blob Data Contributor role to the storage account.
-
Set up the Azure Function App:
- Grant the Synapse workspace the Storage Blob Data Reader role to the storage account.
- Clone the Microsoft Dynamics 365 FastTrack Implementation Assets GitHub repository in Visual Studio.
- Open the CommonDataModel solution from the root of the repo in Analytics\CDMUtilSolution\Microsoft.CommonDataModel.sln
-
Add a NuGet Package Source in Visual Studio:
- Go to Tools > NuGet Package Manager > Package Manager Settings
- Select Package Sources
-
Add the following source:
- Name : nuget.org
- Source : https://api.nuget.org/v3/index.json
- Install .NET Core 3.1 Runtime
- Rebuild the solution and verify that no build errors were reported.
-
Publish the Azure Function App:
- Right-click Clients > CDMUtil_AzureFunctions and click Publish
- Select Azure as the Target and Azure Function App (Windows) as the Specific Target
- Select the appropriate subscription.
- Click the green + to the top right of the Function Apps dialog box to create a new Azure Function App.
- Click Publish
- Select the same region and Storage Account that were used in previous steps.
- Click Create
- Click Finish
-
Configure the Azure Function App:
-
Enable the System-assigned managed identity to the Function App:
- Select Identity
- Set the status to On
-
Configure the Application Settings of the Function App:
- Select Configuration
-
Add the following configuration values:
- TenantId : The Microsoft Entra ID Tenant ID
- SQLEndpoint : The Synapse Serverless SQL Pool connection string
- Schema : cdc
- DDLType : SynapseView (can also be omitted, as this is the default)
- ManifestURL : https://<container name>.blob.core.windows.net/dynamics365-financeandoperations/<environment>.sandbox.operations.dynamics.com/ChangeFeed/ChangeFeed.manifest.cdm.json
- DefaultStringLength : 4000
-
Grant the Function App IAM Permissions to the storage account:
- Select Access Control (IAM)
-
Grant the Function App the following permissions:
- Storage Blob Data Contributor
- Storage Blob Data Reader
-
Add a new Event Subscription in the Storage Account with the following details:
- Name : CdmIsJsonCreated
- Event Schema : Event Grid Schema
- System Topic : <container name>-system-topic
- Event Type : Blob Created
- Endpoint Type : Azure Function
- Endpoint : EventGrid_CDMToSynapseView
-
Update the filters:
- Subject begins with: /blobServices/default/containers/dynamics365-financeandoperations/blobs/.sandbox.operations.dynamics.com/ChangeFeed
- Subject ends with: .cdm.json
-
Advanced filters:
- data.url does not end with .manifest.cdm.json
- data.url does not contain /resolved/
- data.url does not contain /Tables/
- Configure Application Insights for the Function App using the Microsoft documentation.
-
Enable the System-assigned managed identity to the Function App:
Use Serverless Pool as a Source to read data
In this procedure, you will connect Jet to the data source.
- Open the Jet D365 project.
-
Connect to Serverless Pool to Read Data:
- Under Business units , open the data source for Serverless
- Right-click the data source and select Edit SQL Server data source The Edit SQL Server Data Source dialog box opens.
- Enter the Server name , the authentication credentials for the Serverless pool, and select the appropriate Database name
- Click Test Connection to verify that you can connect to the data source successfully.