Automate the activation of required tables in the Synapse Link for dataverse

Sriram M 40 Reputation points
2024-08-02T15:06:37.99+00:00

Hi All,

I am using Synapse Link for Dataverse for loading data from Dynamics 365 to ADLS.

I have to manually activate the required tables in the Synapse link inside the dataverse, which is a pain point every time.

Q1. Is there a way to automate this process of activating required tables in the Synapse Link?

Q2. Once the activation is done in the development environment, the same tables I want to activate in the higher environment, how to deploy the same to test, pre-prod and prod environment (As it is difficult again to activate all those tables manually in the Synapse Link)?

Thanks in advance.

Regards,

Sriram M.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,927 questions
Microsoft Power Platform Training
Microsoft Power Platform Training
Microsoft Power Platform: An integrated set of Microsoft business intelligence services.Training: Instruction to develop new skills.
412 questions
Microsoft Dataverse Training
Microsoft Dataverse Training
Microsoft Dataverse: A Microsoft service that enables secure storage and management of data used by business apps. Previously known as Common Data Service.Training: Instruction to develop new skills.
34 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 24,711 Reputation points
    2024-08-05T16:13:24.2666667+00:00

    To automate the activation of required tables in Synapse Link, you can use PowerShell scripts with the Microsoft.PowerPlatform.Cds.Client library. Below are the steps to achieve this:

    1. Install Required Modules: Ensure you have the necessary PowerShell modules installed:
      
         Install-Module -Name Microsoft.PowerPlatform.Cds.Client -AllowClobber -Force
      
         Install-Module -Name AzureAD
      
      
    2. Authenticate to Dataverse: Use OAuth to authenticate to your Dataverse environment:
      
         $ClientId = "your-client-id"
      
         $ClientSecret = "your-client-secret"
      
         $TenantId = "your-tenant-id"
      
         $OrgUrl = "https://your-org.crm.dynamics.com"
      
         $AuthResult = Get-CdsConnection -ClientId $ClientId -ClientSecret $ClientSecret -TenantId $TenantId -OrganizationUrl $OrgUrl
      
      
    3. Activate Tables: Create a script to activate the required tables. This involves using the Set-CdsTable cmdlet to enable Synapse Link for each table:
         
         $tables = @("table1", "table2", "table3") # List of tables to activate
         
         foreach ($table in $tables) {
         
          Set-CdsTable -Connection $AuthResult.Connection -EntityLogicalName $table -IsSynapseLinkEnabled $true
         
         }
         
      

    To replicate the activated tables from the development environment to other environments like test, pre-prod, and prod, you can use a combination of solution export/import and deployment scripts.

    1. Export the Solution: Export the solution from your development environment that includes the table settings:
      
         Export-CdsSolution -Connection $AuthResult.Connection -SolutionName "YourSolutionName" -OutputFilePath "C:\Path\To\ExportedSolution.zip"
      
      
    2. Import the Solution: Import the exported solution into the target environment:
      
         $targetOrgUrl = "https://your-target-org.crm.dynamics.com"
      
         $TargetAuthResult = Get-CdsConnection -ClientId $ClientId -ClientSecret $ClientSecret -TenantId $TenantId -OrganizationUrl $targetOrgUrl
      
         Import-CdsSolution -Connection $TargetAuthResult.Connection -SolutionFilePath "C:\Path\To\ExportedSolution.zip"
      
      
    3. Activate Tables in Target Environment: Run a similar activation script as used in the development environment to ensure the tables are activated in the target environment:
      
         $targetTables = @("table1", "table2", "table3") # List of tables to activate in target environment
      
         foreach ($table in $targetTables) {
      
             Set-CdsTable -Connection $TargetAuthResult.Connection -EntityLogicalName $table -IsSynapseLinkEnabled $true
      
         }
      
      

    Additional Tips:

    • Automate with Azure DevOps: Consider using Azure DevOps pipelines to automate these scripts, allowing for CI/CD deployment.
    • Configuration Management: Use a configuration file to manage the list of tables and environment-specific details to simplify maintenance.

    By following these steps, you can automate the activation of required tables in Synapse Link for Dataverse and deploy these settings across different environments efficiently.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.