Azure Kubernetes Service (AKS) with Azure DevOps — Part 1

  • Understand the basic process flow of Azure DevOps

Prerequisite Actions

Continuous Integration (CI)

  • Make sure a service connection from Azure DevOps to Azure Resource Manager (ARM) is created. This setup is for Azure DevOps to be able to leverage the yet-created Azure active directory service principal (AAD SP) for performing all sorts of operations. Normally, this AAD SP would be getting contributor role in the target Azure subscription. Please refer to this site for more information.
  • Within the CI pipeline, notice the file would be named as “azure-pipelines.yml) and all the actions would be added into the file in the following format. The operations we have here are
- Docker Compose (Build services): To read the "Dockerfile" in you connected repository, build a local container image and run an application based on that local container image.- Docker Compose (Push services): After knowing the container image could be build and run, tag the container image and push it to the target ACR.- Copy Files: This is to copy the file "deployment.yml" from connected repository to Azure DevOps space. Notice at this point, the referred image is still the local one.- Publish Artifact: Artifact is another word for whatever you created in the operation process. In this case, the copied file (deployment.yml) would be put in somewhere within Azure DevOps so future operations could use it.

Continuous Deployment (CD)

- Job: Only 1 agent job in this setup. However, you could add as many as needed.- Tasks:
1. Install Kubectl latest: This is pretty self-explanatory, which is installing the latest Kubernetes client command tool in the agent VM.
2. kubectl create: This is the operation to create a new namespace. With more and more deployments in the Kubernetes environment, you would need to separate them with namespaces. It is easy to find and easy to troubleshoot.3. kubectl apply: This is the operation to deploy the actual applications into the AKS cluster, which could include deployments, services, service accounts etc. 4. kubectl set: This is to switch out the image that is being used in the current deployment. We know that local container image works and is uploaded to ACR. Now, we would need to have the application to use the ACR's image instead of the local one. This is to ensure in the future, whenever there is a change in the container image, after the whole CI/CD process, the application would be running in the latest image.




Learning new things about Kubernetes every day. Hopefully, the learning notes could help people on the same journey!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

CakePHP 4 How To Get Query String Parameters Tutorial

Building a Serverless Not Hot Dog app

Flutter Performance Tips — Part 2

Obaseki to Wike: PDP is not your personal property, Edo cannot be procured

We can choose the manner of our future development

Make a translate app with HuggingFace Transformers

Jenkins Ansible to Deploy Java App -Small DevOps Project

My First Dive Into An Open Source Project

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


Learning new things about Kubernetes every day. Hopefully, the learning notes could help people on the same journey!

More from Medium

Use Terraform and Azure DevOps to Provision Azure Kubernetes Service (AKS)

Creating an AKS Cluster With Application Gateway (AGIC)

Best Practices for AKS cluster security and upgrades

Creating an AKS Release Pipeline in Azure DevOps