Configure Dataverse exports using Azure Synapse Links for Azure SQL Databases Microsoft Azure image 17

In this post I’m looking at the Azure SQL databases option that is part of the Azure Synapse link configuration.

A bit of background

Azure Synapse Links let you configure Dataverse exports to Azure. Quite often this results in a file structure in azure storage that holds csv files. These csv files are organised in such a way that the year (or month) of the records creation in Dataverse decide where your exported data will end up.

So typically you would get 2022.csv, 2021.csv, 2020.csv for records that have been created in the last three years. Any new updates are now appended to these files as updates are made to the records.

If you now want a process to use this data you will have to read the full csv file, only to find out that the last line in the csv file includes the update that you are interested in.

It feels like we need a proper database to do the job here. In this post the steps to setup your Synapse Links.

Create a SQL Database

The next step is to create a SQL database in Azure. This database will be used later on for Synapse Analytics to store its data.

create SQL database

To keep the cost down I’m selecting Development. However in production environments you might want to select Production. In my case £4.30 is is better than £211.

Configure Dataverse exports using Azure Synapse Links for Azure SQL Databases Microsoft Azure image 12

Once the SQL database has been created we should be ready for the next steps.

Please make sure that you have enabled the Allow Azure services and resources to access this server setting.

Create a Synapse workspace

First I went to my Azure Portal and went to the Synapse workspace overview. Then I hit the create option and this is where it all begins.

A big form that needs to be completed.

Configure Dataverse exports using Azure Synapse Links for Azure SQL Databases Microsoft Azure image 5

After completing this form, it looks like this. Note that as always a lot of the naming within Azure is very restricted. So for example the accountname has to be in lower case. And a lot of the below has to be unique as well.

Configure Dataverse exports using Azure Synapse Links for Azure SQL Databases Microsoft Azure image 6

So first of all we had to create some Resource groups. I prefer to create the Managed resource group as this controls the naming a bit better then letting Azure generate this for me but you can also leave that empty.

Then we have an account name. This is the Data lake Generation 2 storage.

Now before hitting the Review + /create button, we will need to set the Security and Network settings for the workspace that we will create.

Configure Dataverse exports using Azure Synapse Links for Azure SQL Databases Microsoft Azure image 7

.

Once the above settings have been completed the Synapse Workspace can be created.

Configure the Linked connection

Once the workspace is created you will find the option to open Azure Synapse Analytics Studio link. This will open your workspace.

Configure Dataverse exports using Azure Synapse Links for Azure SQL Databases Microsoft Azure image 20

Click on the Link connection for the next step.

Configure Dataverse exports using Azure Synapse Links for Azure SQL Databases Microsoft Azure image 21

Now click on the New to create a new linked service. This new linked service will need to be configured as shown below:

Configure Dataverse exports using Azure Synapse Links for Azure SQL Databases Microsoft Azure image 19

Notice that only System Assigned Managed Identity works as the Authentication Type.

Configure Dataverse exports using Azure Synapse Links for Azure SQL Databases Microsoft Azure image 31

Configure access to the resource group

Configure Dataverse exports using Azure Synapse Links for Azure SQL Databases Microsoft Azure image 32

Click on the add role assignment.

And then select the Owner role and add the Managed Identify that was created earlier.

Configure Dataverse exports using Azure Synapse Links for Azure SQL Databases Microsoft Azure image 34
Configure Dataverse exports using Azure Synapse Links for Azure SQL Databases Microsoft Azure image 33

Create a Azure Synapse Link in Dataverse

The next step is to create an Azure Synapse Link in Dataverse. Do make sure that you tick the box to Connect to your Azure Synapse Analytics workspace!

Azure Synapse link

This is where we select the tables that we want to sync. In my example I will only sync the accounts table. And I will partition my data on a monthly basis so that I get more smaller files.

Configure Dataverse exports using Azure Synapse Links for Azure SQL Databases Microsoft Azure image 9

Now, you can click on the Go to Azure Synapse Analytics workspace. This will open the Azure Synapse Analytics workspace. If you notice that you haven’t got this option available then you didn’t select the earlier mentioned tick box.

Configure Dataverse exports using Azure Synapse Links for Azure SQL Databases Microsoft Azure image 18

Now we want to see our data!

In the Synapse Analytics Workspace, I can now find my tables that I’m syncing. Job done!

Configure Dataverse exports using Azure Synapse Links for Azure SQL Databases Microsoft Azure image 35

Avatar for Pieter Veenstra

By Pieter Veenstra

Business Applications and Office Apps & Services Microsoft MVP working as a Microsoft Productivity Principal Consultant at HybrIT Services. You can contact me using contact@veenstra.me.uk.

11 thoughts on “Configure Dataverse exports using Azure Synapse Links for Azure SQL Databases”
  1. Hi,
    I am following https://learn.microsoft.com/en-us/power-apps/maker/data-platform/azure-synapse-link-pipelines?tabs=synapse-analytics this Microsoft documentation, but on execution of pipeline getting following these errors:
    Inner activity name: CreateTable, Error: There is already an object named ‘contact’ in the database.
    Column names in each table must be unique. Column name ‘Id’ in table ‘contact’ is specified more than once.

    Before running the pipeline there was no such table in database

    any ideas

    Thanks

    Wajih

  2. Pieter, I am not able to see purpose and use of SQL server in above scenario. Can you please let me know where and how it is used?

  3. how the data will move from dataverse to sql server. my understanding is that syanpse link will export data into datalake and create serverless views synapse analytics.
    after that how data is moving to sql server, i am not able to figure that out.

  4. I was able to make it working. The issue was related to the SQL User default schema. However, I have quite a large data in some tables and that is taking long to sync data in Azure SQL, but Storage Trigger is called after each hour and in few hours many pipelines are running simultaneously, even there is no change in CRM during that time. Can we control trigger?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.