How to do canary deployment in Azure?

What is canary deployment?

A canary deployment is an automatic technique for testing your canary deployment.

This is a canary in which the canary deployment is tested automatically. The idea behind canary deployments is that if a canary deployment fails, it can tell you about the problem in real time and so hopefully before your deployment goes out to production.

How does it work? Everytime a build succeeds, it will be added to the Canary Deployment's list. The deployment process checks if all these successfully built and if any fail then the deployment fails. This is how canary deployments work; everytime they build the canary deployment a new build can be deployed and so everytime canary deployments builds, a build can be deployed.

Why use canary deployment? Canary deployment helps by saving you from your production release in case of any failure, however, the idea is not to depend on just this single build alone because if the build fails then you miss the golden time of opportunity to address the issue and fix it with minimal impact on your system. Instead of depending on just this one build alone to test your canary deployment, you need to deploy the canary deployment periodically during the development process or testing process of your application by checking their current state. Since everytime you check this list and deploy your new build it tells you that there are no errors in your deployment code, you know that whatever build you're checking will never give an error. Since you don't have to worry about not detecting errors since if they do fail, you already know that you are going live.

Let's look at an example. I'm going to explain about how will the deployment look like when we use a canary deployment in our case study, in the last section.

Case study. We will use Github as a platform to demonstrate how will a canary deployment look like. We want to create a feature branch (that should make changes in master branch). As you can see in the picture below (below:canary deployed screenshot) GitHub automatically creates the release branch, it starts a build and it deploys the new build. As you can see in the canary deployment process in the image (below:canaryDeployments), GitHub releases builds everytime whenever a build happens in its release branch in the release branch by adding builds to the canary deployed build log in the first line.

What is the difference between canary and rollout deployment?

I am getting mixed answers here in SO on the difference between canary and rollout deployments.

Can you please help me understand the difference? canary is a deployment that allows you to test your deployment process without affecting the production environment. Rollout is a deployment process that allows you to test and review your changes without causing any negative impact on the production environment. Rollout is about changes in code, not about changes in configuration. So, it's possible to have a rollout and still have canary deployment.

How to do canary deployment in Azure?

I am trying to figure out .

I am already using Azure app service and virtual machine with a website and database. And I am able to deploy the new version of website (with all other files, including database) by uploading the new website to Azure, but the database should not be updated and the old version of database should still be available to the application.

This is the way I am thinking: In Azure, I create a new virtual machine with some pre-installed software. Upload the entire new version to Azure, but do not start the new virtual machine (I am not sure if this is possible). Create an API that will create a new website and upload it to Azure, but not the new virtual machine. Now, I am thinking that my steps are incorrect. Or maybe I need to re-factor the steps? It sounds like you don't want a new VM altogether, you just want to copy over your files from your existing VM and point to them in the new one. This can be done in Azure without creating a new VM. Just login into the Portal and click on the "Copy" button next to your App Service to which you want to deploy. Then you have the option to move those files across as well as configure the settings in your application, including the database URL.

Hope this helps!

Related Answers

In which scenario is it best to use canary deployment?

Canary deployment is a term used to refer to a set of Azure-based appli...

What are the disadvantages of canary deployment?

I've always thought that the canary deployment is an alternat...

What is the difference between blue green and canary deployment?

How do I know when a canary has died? As with all things, planning ahead...