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.
1. Connecting to Your AKS Cluster
You can authenticate and configurekubectl in multiple environments:
-
Log in to Azure CLI
-
Verify your active subscription
-
Set a default resource group
-
Download and merge AKS credentials
-
Confirm the current Kubernetes context
2. Inspecting the Cluster State
Before deploying, it’s good practice to confirm that your cluster has no existing workloads:3. Deploying the Sample Application
We previously built and pushed the Docker imagehpranav/kodekloudappcs:v1 to Docker Hub. Deploy it to AKS with a single replica:
4. Exposing the Deployment via Load Balancer
To allow external access, create a Service of typeLoadBalancer. Azure will provision a cloud load balancer and assign a public IP:
Replace
20.50.123.456 with your actual EXTERNAL-IP. It can take a minute for Azure to provision the public IP.http://20.50.123.456 to verify that the sample application is running on your AKS cluster.