Interview Prep/Azure/CI/CD and IaC

Design a GitHub Actions pipeline that builds an image, pushes to ACR and deploys to AKS with no secrets.

IntermediateScenarioCI/CD and IaC
Answer

Situation read → OIDC to a user-assigned identity with AcrPush and namespace-scoped AKS rights.

What I'd do →

  1. Identity id-shop-ci with federated credential repo:org/shop:environment:prod; roles: AcrPush on ACR, Azure Kubernetes Service Cluster User Role on the cluster, Azure Kubernetes Service RBAC Writer on the namespace
  2. Workflow: permissions: id-token: write, azure/login@v2, az acr build or docker build + az acr login + push, tag with ${{ github.sha }}
  3. Deploy job with environment: prod (approval), az aks get-credentials, kubelogin convert-kubeconfig -l azurecli, kubectl apply or helm upgrade --install
  4. kubectl rollout status as the gate

Why → Zero stored secrets, environment approvals gate prod, identity has only what it needs.

Interview tip → Use immutable tags (git SHA), never latest, in deployment manifests.

Azure All Azure questions Roadmap: AKS & Azure DevOps

More on CI/CD and IaC