This guide explains how to deploy a Dockerized sample application to Azure Kubernetes Service using Azure CLI and PowerShell.
After provisioning your AKS cluster (including the resource group, virtual network, and other prerequisites), the next step is to connect via Azure CLI and deploy a Dockerized sample application. This guide will walk you through each step—from authentication to exposing your service—using PowerShell examples that apply equally to macOS and Linux terminals.
All Azure CLI commands shown here work in Azure Cloud Shell, Windows PowerShell, macOS, and Linux terminals. Replace any Windows-specific paths or syntax as needed on other platforms.
Before deploying, it’s good practice to confirm that your cluster has no existing workloads:
Command
Purpose
kubectl get nodes
List all nodes and their status
kubectl get deployments
Show existing deployments in default ns
kubectl get pods
Display running pods in default ns
Copy
Ask AI
PS C:\Users\msadmin> kubectl get nodesNAME STATUS ROLES AGE VERSIONaks-agentpool-18097611-vmss000000 Ready agent 45m v1.24.10PS C:\Users\msadmin> kubectl get deploymentsNo resources found in default namespace.PS C:\Users\msadmin> kubectl get podsNo resources found in default namespace.
As expected, there are no deployments or pods at this point.