Cloud & DevOps

How to Deploy an Application to Azure AKS

Deploy a containerized application to Azure Kubernetes Service using Azure CLI, ACR, kubectl, manifests, verification and production checks.

Application deployment pipeline moving containers into an Azure AKS cluster
Original concept artwork created for this Circuit Compass guide.

This guide shows the deployment path from a container image to a running application on Azure Kubernetes Service. Commands create billable Azure resources, so use a suitable subscription and cleanup plan.

1. Prepare Azure, Docker and kubectl

Use Azure Cloud Shell or install current Azure CLI and kubectl. Sign in with az login, select the intended subscription and confirm that your identity can create resource groups, registries and AKS clusters. Build and test the application container locally before uploading it.

Production note: Microsoft’s quickstart uses evaluation-friendly defaults. Review the AKS baseline architecture, identity, network, backup and monitoring requirements before production.

2. Create the resource group, registry and cluster

  1. Create a resource group with az group create.
  2. Create an Azure Container Registry with az acr create.
  3. Build in ACR with az acr build, or tag and push a locally built image.
  4. Create the cluster with az aks create, using managed identity and an explicit node size and count.
  5. Attach ACR through an appropriate identity-based integration.

Record resource names and region in deployment configuration rather than scattering them across shell history.

3. Connect and deploy the manifests

Retrieve credentials with az aks get-credentials, then verify the context with kubectl config current-context. Define a Deployment with the full ACR image name and a Service that exposes the required port. Preview with kubectl diff -f k8s/, apply with kubectl apply -f k8s/, and wait for kubectl rollout status deployment/APP.

4. Verify, monitor and secure the application

Check pods, events, logs, service endpoints and health probes. Store secrets in an approved secret-management system rather than the image or source repository. Configure resource requests and limits, readiness and liveness probes, autoscaling, network policy, observability and a rollback procedure.

5. Control cost and cleanup

AKS nodes, load balancers, registries and related services can incur charges. For a disposable learning environment, delete the verified resource group with the Azure CLI only after resolving the exact subscription and resource group. Production resources require a reviewed decommission plan and backups.

Frequently asked questions

Do I need Docker to deploy to AKS?

AKS runs OCI-compatible container images. You need a way to build and publish the image; Docker is common but not the only compatible build tool.

Is the AKS quickstart production ready?

No. Microsoft describes quickstart defaults as evaluation-focused and recommends reviewing the baseline architecture before production.

Sources and further reading

Features, software and prices change. Confirm current details with these sources before making a decision.

Found something that needs updating? Send a correction with the page URL and a supporting source.