Skip to content

CICD-272 · Azure AKS deployment ​

Encyclopedia · Cloud infrastructure integration · All snippets

Previous · CICD-271 · Next · CICD-273

1. Where it fits ​

  • Placement CI run step or authorized lab terminal.
  • Prerequisites provider CLI, scoped CI identity, test environment and provider configuration for named resource.
  • Platforms github-actions, cloud-cli.
  • Parameters AKS_NAME, AKS_RG, IMAGE, RUNNER_TEMP.

2. Copy the snippet ​

bash
az aks get-credentials --resource-group "${AKS_RG:?}" --name "${AKS_NAME:?}" --file "$RUNNER_TEMP/aks-kubeconfig" --overwrite-existing
export KUBECONFIG="$RUNNER_TEMP/aks-kubeconfig"
kubectl -n staging set image deployment/web web="${IMAGE:?}"
kubectl -n staging rollout status deployment/web --timeout=180s

3. How it works ​

The Azure CLI writes a kubeconfig for the selected cluster. Confirm the account, group and namespace before applying changes.

4. Verify the result ​

Use a federated identity and namespace RBAC. Azure CLI, kubectl and possibly kubelogin must be provisioned.

Validation syntax-validated (Bash parse). Status definitions.