Interview Prep/Azure/AKS and Containers

An app on AKS must call an Azure OpenAI or Storage API using its own identity. Set it up end to end.

AdvancedScenarioAKS and Containers
Answer

Situation read → Workload identity with a data-plane role on the target.

What I'd do →

  1. az aks update -g rg -n aks --enable-oidc-issuer --enable-workload-identity (if not already)
  2. az identity create -g rg -n id-orders; grant Storage Blob Data Contributor (or Cognitive Services OpenAI User) on the target
  3. Federate: az identity federated-credential create --identity-name id-orders -g rg --name aks-orders --issuer $(az aks show -g rg -n aks --query oidcIssuerProfile.issuerUrl -o tsv) --subject system:serviceaccount:shop:orders-sa --audiences api://AzureADTokenExchange
  4. ServiceAccount annotated with the client ID, pod labelled azure.workload.identity/use: "true"
  5. Code uses DefaultAzureCredential()

Why → No secrets, per-workload identity, works with every Azure SDK.

Interview tip → Note that changing the SA name or namespace breaks the federation subject.

Azure All Azure questions Roadmap: AKS & Azure DevOps

More on AKS and Containers