CI-CD for Synapse Dedicated SQL Pool using YAML templates
Purpose of this blog:
1.Defined end-end process of SQL Pool Deployment from Visual studio SSDT code check-in to continuous integration(Build pipeline) and continuous deployment(Release pipeline) from project perspective.
2. Reusable YAML CI and CD templates which can be implemented in any project because these templates was successfully implemented in projects
Developer Workflow
Continuous integration:
- Develop code in Visual Studio using SSDT on your local machine.(Follow the steps below)
a. Make sure to have SSDT installed on Visual Studio. Follow these steps to get SSDT properly configured:
Install Visual Studio 2019 - Azure Synapse Analytics | Microsoft Docs
b. Connect to git repository and database using Visual Studio and make changes.
Follow the steps detailed in the Microsoft Documentation here: Source Control Integration - Azure Synapse Analytics | Microsoft Docs
c. Use the Schema Compare tool to download the latest changes from the source Synapse Dedicated SQL
pool to your local SQL project in Visual Studio. You can individually select each change you want to
include.
Note: Click the video below to see how to do a schema compare with a SQL server to your local SQL project.
https://www.youtube.com/watch?v=fKM3OGaS5pQ
d. IMPORTANT:
Make sure to do a local build to see if the project builds successfully before committing and merging with
the main branch.
e. Commit and push code to a git branch.
Release Engineer Workflow
Continuous integration:
Build
a. Run build pipeline on your new code that is in the repository. This will use the project solution file to
build a dacpac artifact. Then it will publish this as a release artifact.
Continuous delivery:
Deployment to target environment
a. Run the release pipeline for the specified target environment.
- This will download the previously generated build artifact and dacpac file. It will also download secure
connection strings from Azure KeyVault. Then it will deploy to your Synapse Dedicated SQL Pool using
dacpac deployment.
CI/CD Pipeline Setup
Assumptions:
- Have SQL Server Code in your repository
- Have deployed a dedicated SQL pool to Azure with its accompanying resources
- Folder Structure for example Contoso DB(Below screenshot)
Build Pipeline
Requirements:
- Make sure the pipeline runs on a Windows Agent
- Reason for windows agent : This is because the Visual Studio Build task will only work on windows
Steps:
- Build Task:
- Use the Visual Studio build solution task
- Direct the task to the database solution file ('ContosoDb/ContosoDb.sln' in our POC)
- Set the configuration to release, if not set this will configure as debug
- Example:
- Copy Files Task:
- Copy the files from the build directory to the $(build.artifactstagingdirectory)
- Example:
- Publish Build Artifact Task
- Publish the build artifact with a specified name
- Example:
Full CI YAML Pipeline Example
Release Pipeline
Requirements:
- Make sure the pipeline runs on a Windows Agent
Steps:
- Deployment Job
- Create a deployment job that uses the windows agent
- Example:
-Azure Key Vault Task
- Use the an Azure Key Vault to take store the connection string to the Dedicated SQL Pool
- Grab this connection string from the key vault and input it as an Azure Pipelines Variable
- Example:
- SQL Dacpac Deployment Task
-Specify the location of the .dacpac file in the build artifact from the build pipeline
-Specify the connection string that was taken from the Azure Key Vault task
-Example:
Full Example CD YAML Pipeline
Published on:
Learn moreRelated posts
We're moving!
We’re moving to the Analytics on Azure Tech Community! All new Azure Synapse Analytics content will be published there. In the next few days a...
Upgrade to Azure Synapse runtimes for Apache Spark 3.4 & previous runtimes deprecation
It is important to stay ahead of the curve and keep services up to date. That's why we encourage all Azure Synapse customers with Apache ...
ADF\Synapse Analytics - Replace Columns names using Rule based mapping in Mapping data flows
In real time, the column names from source might not be uniform, some columns will have a space in it, some other columns will not. For exampl...
Interpreting Script activity output json with Azure Data Factory\Synapse analytics
Script activity in Azure Data Factory\ Synapse analytics is very helpful to run queries against data sources mentioned here in this document.&...
Synapse Connectivity Series Part #4 - Advanced network troubleshooting and network trace analysis
Continuing the series of this blog posts I would like to go more advanced on troubleshooting connectivity issues. I would like to thank also&n...
Boost your CICD automation for Synapse SQL Serverless by taking advantage of SSDT and SqlPackage CLI
Introduction Azure Synapse Analytics Serverless SQL is a query service mostly used over the data in your data lake, for data discovery,...
Metadata-Based Ingestion in Synapse with Delta Lake
Overview The crucial first step in any ETL (extract, transform, load) process or data engineering program is ingestion, w...
Missing Fields Added to Dedicated SQL pool Diagnostic Settings Logs
Over the past year, customers have informed the team there were a set of key columns missing in the standalone Dedicated SQL pools (formerly S...
Using Azure DevOps with Synapse Workspaces to create hot fixes in production environments
Have you ever deployed a release to production only to find out a bug has escaped your testing process and now users are being severely impact...
Azure Synapse MVP Corner - March 2023
About this blog series Microsoft Most Valuable Professionals, or MVPs, are technology experts who passionately share their knowledge with the ...