How to generate a paramterized bicep script for ADF/Synapse Linked Services?

JasonW-5564 161 Reputation points
2023-11-08T05:15:16.92+00:00

I want to have a scripted deployment of the same linked services for all my environments (DEV, TST, PROD). I want them to have the same names, but parameterize the connection strings to point to correspond environment's equivalent.

If possible I would also like to script the Synapse WS permissions as well for automated deployment as well. If separate thread needed for this, please disregard.

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.
3,825 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
8,511 questions
{count} votes

1 answer

Sort by: Most helpful
  1. phemanth 1,280 Reputation points Microsoft Vendor
    2023-11-08T11:25:31.9833333+00:00

    @JasonW-5564

    Thanks for using MS Q&A

    To script the deployment of the same linked services for all environments in Azure Synapse Analytics, you can follow these steps:

    1. Create an Azure Key Vault (AKV) per environment to hold the connection strings for the linked services.
    2. Create an Azure Key Vault Linked Service in each environment with the same name.
    3. Create a parameter for each linked service in the SynapseWorkspaceDeployment task on Azure DevOps.
    4. Override the parameters on the SynapseWorkspaceDeployment task during the CI/CD process to change the URL in the deployed linked services.
    5. Use the Azure portal or a programming interface to parameterize linked services. 
    6. Use the Synapse workspace deployment extension to deploy other items in your Azure Synapse workspace, such as datasets, SQL scripts and notebooks, spark job definitions, integration runtime, data flow, credentials, and other artifacts in the workspace.

    reference: Parameterize linked services - Azure Data Factory & Azure Synapse | Microsoft Learn

    Regarding scripting the Synapse WS permissions for automated deployment :

    you can use Azure DevOps or GitHub Actions to automate the deployment of an Azure Synapse workspace to multiple environments. You can use the Synapse workspace deployment extension to deploy other items in your Azure Synapse workspace, including Synapse WS permissions.You can also refer to the following resources for more information on CI/CD deployment of Azure Synapse Analytics:

    Hope this helps. if you have further queries, please do let us know.

    1 person found this answer helpful.