Loading...

Using Azure DevOps with Synapse Workspaces to create hot fixes in production environments

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 impacted? In this post, I’ll discuss how to deploy a fix from your development Synapse Workspace into a production Synapse Workspace without adversely affecting ongoing development projects.

 

This example uses Azure DevOps for CICD along with a Synapse extension for Azure DevOps: Synapse Workspace Deployment. In this example, I assume Synapse is already configured for source control with Azure DevOps Git and Build and Release pipelines are already defined in Azure DevOps. Instructions on how to apply this this can be found in the Azure Synapse documentation for continuous integration and delivery.

 

Let’s start by looking at an example of development activities in a Synapse workspace. During development, several things happen. The Main (aka. collaboration, trunk or master) branch in the Synapse Development environment gets branched off one or more times to support parallel feature development activities. Changes are committed within the feature branches. Periodically, the branches need to refresh their code with the latest changes that have been incorporated into Main. It is typically up to the developer working on a feature branch to merge their code from Main at whatever interval they choose. These activities can all be done through the Synapse user interface by executing a pull request in the proper direction, in this case from Main to Feature 1. It is up to the feature developers to resolve conflicts in their feature branch.

 

Parallel Feature Development FlowParallel Feature Development Flow

 

 

At some point, code in the Main branch is ready for deployment to the Synapse Test environment. After testing, a decision is made to release the code into Production. This is done through an Azure DevOps release pipeline outside the scope of this document. For the sake of simplicity, the following diagrams omit the Synapse Test environment and only show the Synapse Development and Production environments since we are targeting a Production “hot fix” use case. Best practice would be to have at least one intermediate environment between Development and Production.

 

After a Production release, development continues on with Feature 3…N, and changes are incorporated into the Main branch as shown in the diagram below.

 

Feature Development With Release PipelineFeature Development With Release Pipeline

 

 

Now to the heart of the discussion... At some point, a critical bug is discovered in Production that needs to be fixed immediately. How do we do this?

 

Bug Found In ReleaseBug Found In Release

 

Start by getting the Commit ID of the code that was released to production and create a new branch based on the Commit ID. These steps must be done through Azure DevOps.

 

In Azure DevOps, navigate to Pipelines/Releases, and select the appropriate deployment pipeline for the production release. Then select the appropriate release.

 

Note: It is important to have the release pipeline have access to both the ARM templates created by the build process, as well as the actual source code. The ARM templates are used for deployment into later stages (Test/QA/Prod/etc). The source code will be used for hot fixes.

 

Getting The Commit ID Of A ReleaseGetting The Commit ID Of A Release

 

Copy the Commit ID (this looks like an 8 character hex string in the UX, but is actually only the first 8 characters of a longer SHA) for the released code as shown in the diagram below. Make sure you select the Commit ID for the source code and not the ARM template artifact.

 

Commit IDCommit ID

 

Navigate to the branches section of your Azure DevOps Repo and create a new branch based on the Commit ID you copied in the last step.

 

Create New BranchCreate New Branch

 

Select the pulldown on “main” to get to the UX screen that allows you to search for a specific Commit:

 

Base Branch On Commit IDBase Branch On Commit ID

 

Validate that the new branch is based on the proper Commit ID:

 

Validate Commit ID For BranchValidate Commit ID For Branch

 

Now that we have a special code branch for creating the fix, we can go back into the Development Synapse Workspace, select the hot fix branch, and make our corrections.

 

DevOps Flow With New Hot Fix BranchDevOps Flow With New Hot Fix Branch

 

 

When satisfied with the changes, commit them to the branch. In order to get changes in the hot fix branch deployed to Production without impacting the Development and Test environments, we need to create a new Azure DevOps release pipeline incorporating the Synapse Workspace Extension task. In our example, the release of the hot fix branch into Production is triggered manually in Azure DevOps.

 

The hot fix branch should remain in existence for the life of the Production release it is associated with, so that future hotfixes can be incorporated easily.

 

Let’s create a new release pipeline specifically for hot fixes following the instructions for Synapse continuous integration and delivery. We will make a couple modifications to the pipeline that is created in that document. First, the source artifact for this pipeline should have a default branch pointing to the hot fix branch for this release (ie Release3_Hotfixes in our example). Update the source alias to reflect the proper code branch. Update the stage name to “Production_Hotfix”.

 

Define Hot Fix Release PipelineDefine Hot Fix Release Pipeline

 

Now click on the “1 job, 0 task” link under the stage name. Add a new agent job. Search for Synapse and select the “Toggle” task. Update the fields as appropriate for your Production environment. For the subscription, use a service connection for the Prod environment. You can see how to create service connections in this document.

 

First Task In PipelineFirst Task In Pipeline

 

Add another agent task. Search for Synapse and add the task called “Synapse Workspace Deployment”. Update the fields as shown in the screenshot below, replacing values as appropriate with names in your Production environment. Make sure the operation type is “Validate and Deploy”.

 

Second Task In PipelineSecond Task In Pipeline

 

Add another agent task; search for Synapse and add the task called “Azure Synapse Toggle Triggers”. Update the fields as shown in the screenshot below, replacing values as appropriate with names in your Production environment. Rename the pipeline to something meaningful. Save your pipeline.

 

Third Task In PipelineThird Task In Pipeline

 

The pipeline we just created must be manually run to deploy the hot fix to Production. Go into Azure DevOps and create a new release using this pipeline when you are ready.

 

Create New Hot Fix Release To ProductionCreate New Hot Fix Release To Production

 

We have now completed the hot fix release flow shown below. Validate that your Synapse Development Main code branch and live mode UX are unaffected by the hot fix.

 

Released Hot Fix DiagramReleased Hot Fix Diagram

 

Don’t forget to incorporate the hot fix code changes back into the Main and Feature branches at a convenient time. As new releases are deployed, new hot fix branches based on the Commit ID of the release will need to be created. Hot fix branches associated with releases that are no longer current can be deleted.

 

Completed DevOps Flow ExampleCompleted DevOps Flow Example

 

That’s all there is! Congratulations on fixing the burning issue without interrupting ongoing development and testing.  

Published on:

Learn more
Need help with this product?

We can help you with Using Azure DevOps with Synapse Workspaces to create hot fixes in production environments

If you want help implementing, troubleshooting, or improving this product, contact us and we’ll point you in the right direction.

Azure Synapse Analytics Blog articles
Azure Synapse Analytics Blog articles

Azure Synapse Analytics Blog articles

Share post:

Related 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...

1 year ago

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 ...

2 years ago

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...

2 years ago

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.&...

2 years ago

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...

2 years ago

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,...

2 years ago

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...

3 years ago

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...

3 years ago

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 ...

3 years ago

CI & CD With Azure Synapse Dedicated SQL Pool

Author(s): Pradeep Srikakolapu is a Program Manager in Azure Synapse Customer Success Engineering (CSE) team.    Automating de...

3 years ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.