Best Practice for Excluding Linked Services from Overwrite During Azure Synapse Workspace Deployment via Azure DevOps

Napsty Dev 20 Reputation points
2025-05-18T15:17:56.09+00:00

I've implemented a complete CI/CD system for Azure Synapse using Azure DevOps. When deploying content from the development workspace to the QA workspace, all artifacts are currently overwritten — which is expected and helps maintain consistency between environments.

However, I’d like to exclude specific artifacts (such as linked services) from being overwritten during deployment. My goal is to maintain environment-specific configurations for linked services (e.g., different credentials or endpoints in dev, qa, and prod), while still allowing other artifacts (datasets, pipelines, notebooks, etc.) to be updated as usual.

Question

What is the recommended approach or best practice to prevent certain artifacts (like linked services) from being overwritten during deployment between Synapse workspaces using Azure DevOps?

Current Azure DevOps Pipeline for Deployment

trigger:
  branches:
    include:
      - qa

pool:
  vmImage: 'ubuntu-latest'

variables:
  - group: goat-config

steps:
  - task: Synapse workspace deployment@2
    inputs:
      operation: 'deploy'
      TemplateFile: '$(Build.SourcesDirectory)$(templateFilePath)'
      ParametersFile: '$(Build.SourcesDirectory)$(parametersFilePath)'
      azureSubscription: '$(azureSubscription)'
      ResourceGroupName: '$(resourceGroupName)'
      TargetWorkspaceName: '$(workspaceName)'
      DeleteArtifactsNotInTemplate: true
      DeployManagedPrivateEndpoints: false
      FailOnMissingOverrides: false
      Environment: 'prod'
      npmpackage: 'prod'

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.
5,378 questions
{count} votes

1 answer

Sort by: Most helpful
  1. phemanth 15,765 Reputation points Microsoft External Staff Moderator
    2025-05-19T05:17:03.9366667+00:00

    @Napsty Dev

    It seems like you're trying to implement a CI/CD process for Azure Synapse and want to prevent specific artifacts, like linked services, from being overwritten during deployments. This can be a common requirement when maintaining environment-specific configurations.

    Here's a recommended approach to achieve this:

    Use Parameters: In your ARM template, parameterize the properties of the linked services that differ between environments, such as connection strings, credentials, or endpoints. This way, you can provide environment-specific values during deployment without overwriting the entire linked service.

    Separate YAML Files: Consider having separate parameters files for different environments. For example, parameters.dev.json, parameters.qa.json, etc., can hold unique linked service configurations while allowing other artifacts to be continuously updated.

    Modify your Deployment Task: In your Azure DevOps pipeline, make sure to set DeleteArtifactsNotInTemplate: false. This setting will prevent the linked services from being deleted if they're not part of the deployment template.

    Conditional Deployment: Utilize conditions in your deployment pipeline to skip linked services or modify the deployment task in such a way that it only processes necessary artifacts.

    Check for Updates: Since Azure DevOps continually evolves, keep an eye on the official Azure documentation and GitHub repositories for any updates on new features that can assist with this.

    Ultimately, by structuring your templates and parameters correctly and configuring the pipeline to respect these differences, you can achieve a smooth deployment process that meets your needs.

    If you have any more questions or need clarification on certain steps, here are a few follow-up questions:

    • Are you currently using ARM templates or Bicep files for deployment?
    • What specific configurations do your linked services have that vary between development and QA?
    • Have you considered using Key Vault for managing secrets across environments, and if so, how is that set up?
    1 person found this answer helpful.
    0 comments No comments

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.