The purpose of this blog is to give you an overview of Azure DevOps and how it can be used to build the CI/CD pipeline (Visual Studio Team Services).
Azure DevOps is a very strong hosted service which provides development and collaboration tools. There are many services available which can be used to build the CI/CD pipeline. It makes work simple and understandable. It provides free tier to get started and we don’t need our own agents to start with like Git repositories for source control, build and release pipeline for CI/CD automation and many more.
It provides a lot of inbuilt features and functionalities that allows teams to get up and running with managing their project and automate their workflows to increase productivity.
First of all, you should have an account on VSTS. Create a new project and get started.
Now, let's have a look at how to deploy a Nginx image to Web app through the VSTS.
We have Azure Web App for containers which help to deploy container-based web apps. We can pull images from Azure Container Registry (ACR) and Docker Hub and then deploy the containerized app with required dependencies.
First Step: Configuring CI pipeline to build and publish Docker image
FROM ubuntu
# Upgrade and Install Nginx
RUN apt-get update && apt-get install -y \
Nginx \
vim \
software-properties-common
# Autostart Services
COPY ./ Docker-entrypoint.sh /usr/local/bin
RUN chmod a+x /usr/local/bin/ Docker-entrypoint.sh
# Nginx configuration
COPY ./ Nginx/default /etc/ Nginx/sites-available/default
COPY ./ Nginx/default /etc/ Nginx/sites-enabled/default
# expose the port 80
EXPOSE 80
ENTRYPOINT ["entrypoint.sh"]
# Run Nginx
Nginx -g "daemon off;"
Step Second: Deploying to an Azure Web App for container
Hope this article helped in knowing Azure DevOps and how it can be used to build the CI/CD pipeline (Visual Studio Team Services).