Interview Prep/Azure/AKS and Containers

A team wants to deploy a new microservice to AKS that reads a database password. How do you wire secrets?

BeginnerScenarioAKS and Containers
Answer

Situation read → Key Vault + CSI driver + workload identity; no secrets in git or plain Kubernetes Secrets.

What I'd do →

  1. Store the secret: az keyvault secret set --vault-name kv-shop -n db-password --value ...
  2. Create a user-assigned identity, grant Key Vault Secrets User on the vault, add a federated credential for system:serviceaccount:shop:orders-sa
  3. Create the ServiceAccount with azure.workload.identity/client-id annotation
  4. Create a SecretProviderClass with clientID, keyvaultName, tenantId and the object list
  5. Mount it in the Deployment (csi volume, driver secrets-store.csi.k8s.io), with pod label azure.workload.identity/use: "true"

Why → One identity per workload, revocable in Azure, auditable in Key Vault logs.

Interview tip → Mention Entra auth to the DB itself to avoid the password entirely.

Azure All Azure questions Roadmap: AKS & Azure DevOps

More on AKS and Containers