How to change external datasource as per environment for Synapse Serverless SQL CI/CD pipeline via azure devops ?

Siddharth Joshi 231 Reputation points
2023-04-04T09:18:29.31+00:00

Hi, I'm deploying serverless sql objects like external tables, external resources, data source, views etc via azure devops dacpac deployment but my deployment is failing because my view is pointing two external tables and those tables point to Dev ADLS but as I'm deploying all objects to UAT and my UAT ADLS is different that's why my deployment is failing so I want to change ADLS endpoint to UAT before publishing to UAT but via dacpac. Please let me know how I can do this ?

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
0 comments No comments
{count} vote

Accepted answer
  1. AnnuKumari-MSFT 34,556 Reputation points Microsoft Employee Moderator
    2023-04-06T07:03:02.75+00:00

    @Siddharth Joshi Thankyou for using Microsoft Q&A platform and thanks for posting your question here. I understand you want to override ADLS endpoints for higher environment while deploying serverless sql resources using dacpac. You can try using SQLCMD variables to change the ADLS endpoint before publishing to UAT via DACPAC.

    1. In your SQL script, replace the ADLS endpoint with a SQLCMD variable. For example, replace https://devadls.blob.core.windows.net with $(adls_endpoint).
    2. In your Azure DevOps pipeline, define a SQLCMD variable named adls_endpoint with the value of your UAT ADLS endpoint.
    3. In your DACPAC deployment task, add the /v:adls_endpoint=$(adls_endpoint) argument to the Additional SqlPackage.exe arguments field.

    You can find more relevant information in below resources: Deploying a dacpac to a serverless SQL pool
    sqlcmd - Use with scripting variables Use SQLCMD Variables for User Name in DACPAC

    Hope it helps. Kindly accept the answer if it helped. Thankyou


0 additional answers

Sort by: Most helpful

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.