Useful AKS (Azure Kubernetes Service) related Commands

Login to Azure Using az CLI

# Log in to your Azure account
az login

# Set your subscription
az account set --subscription <subscription_id>

# Get information about your AKS cluster
az aks show --resource-group <resource_group> --name <aks_cluster_name>

# Get the AKS credentials
az aks get-credentials --resource-group <resource_group> --name <aks_cluster_name>

kubectl

# Get the AKS credentials
az aks get-credentials --resource-group <resource_group> --name <aks_cluster_name>

# Get the nodes in your cluster
kubectl get nodes

kubectl get namespace

kubectl get pods -n <namesapce>

kubectl logs [-f] <pod> -n <namesapce>

kubectl get networkpolicies --all-namespaces