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 →
- Identity
id-shop-ciwith federated credentialrepo:org/shop:environment:prod; roles:AcrPushon ACR,Azure Kubernetes Service Cluster User Roleon the cluster,Azure Kubernetes Service RBAC Writeron the namespace - Workflow:
permissions: id-token: write,azure/login@v2,az acr buildordocker build+az acr login+ push, tag with${{ github.sha }} - Deploy job with
environment: prod(approval),az aks get-credentials,kubelogin convert-kubeconfig -l azurecli,kubectl applyorhelm upgrade --install kubectl rollout statusas 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.
More on CI/CD and IaC
Your organisation uses Azure DevOps. Set up a secure deployment pipeline to AKS.IntermediateYou need to promote the same image from dev to staging to prod. How do you design it?IntermediateTerraform state for prod is in a storage account accessible with account keys. Harden it.IntermediateYour team wants to move from ARM JSON templates to Bicep. How do you migrate?BeginnerA pipeline needs to deploy to dev, test and prod in different subscriptions. How do you handle identities?AdvancedThe Terraform plan for a small change shows the AKS cluster will be replaced. What do you do?Advanced