In a previous blog, Azure Web Apps in Docker Containers, I explored hosting dockerized web apps in Azure. In this post, we will walk through how to set up Azure continuous deployment using the Deployment Center.
Azure Continuous Deployment is used to shorten the release cycle and quickly get code pushed to its target environment. This is especially useful when code is completed in small increments. Automated testing should be used as part of this process to produce stable code. This blog will focus on the continuous deployment. To do this, we will work through and complete the following steps:
- Configure the Deployment Center
- View Azure DevOps Release Pipeline
- Verify Continuous Deployment
An important note: I would suggest reviewing my previous post before continuing with this post. Steps that were discussed in Part 1 will not be repeated in this blog.
Another important note: An Azure account is required. If you do not already have one, you can set up a free account, but it will require a credit card.
Step 1: Configure the Deployment Center
First things first, we need to configure the deployment center.
- Login to the Azure portal.
- Navigate to
App Services
, then selectazure-docker-container-example
. - In the Menu under
Deployment
, selectDeployment Center
. - Click
Get started
. - Select
GitHub
. - Click
Next
, then selectAuthorize
. This will give Azure access to GitHub. - Select
Repository
, thenBranch
. - To confirm Application Settings, click
Next
. - Complete the
Azure DevOps project
form and click Done.
At this point, the successful setup screen appears.
The final step is to click Release pipeline
, located below the Success setup message. This will redirect to Azure DevOps > Pipelines > Releases.
Step 2: Viewing the Azure DevOps Release Pipeline
Azure Pipelines are a powerful feature in Azure DevOps. The pipelines are great for automated testing to catch bugs before they reach production. Pipelines can also be used to establish various stages in the process.
For the purpose of this blog, we will simply use it to deploy the code. Look at the Releases and notice the date and time. We will revisit this page after we make changes to the site.
Step 3:Verify Continuous Deployment
Let’s verify continuous deployment is working. This is important to make sure the configuration is correct and nothing was missed.
In the GitHub repository, update the App.js page.
- Navigate to the App.js file located at AzureDockerBlog / azure / src /
- Make an update and click the
Commit changes
button.
And Now, Back to Azure DevOps
The app can take up to several minutes to update, so try to be patient.
To see if the update went through, navigate back to the site. If you did it correctly, it should be up and running, and you’ll see a screen like this!
Wrap Up
Continuous delivery automates the release of code which shortens the cycle from development to production. It accomplishes this by creating releases when the code is ready, not when an individual is ready to release the code.
We started by configuring the Deployment Center of the App Service. The configuration created a release pipeline that we viewed in Azure DevOps. Then, we updated the source code in GitHub to view the continuous integration take place. Finally, we viewed the updated site.