Interview Prep/Azure/CI/CD and IaC

Terraform state for prod is in a storage account accessible with account keys. Harden it.

IntermediateScenarioCI/CD and IaC
Answer

Situation read → State contains secrets and is the keys to the kingdom. Entra auth, network isolation, recovery.

What I'd do →

  1. Backend use_azuread_auth = true; grant Storage Blob Data Contributor on the container to the pipeline identity only
  2. az storage account update --allow-shared-key-access false
  3. Enable blob versioning and soft delete; CanNotDelete lock on the account
  4. Private Endpoint (with private agents) or network rules limiting access
  5. Separate state per environment, separate identities per environment

Why → Versioning recovers from corrupted state, RBAC limits who can read secrets in state, locks stop deletion.

Interview tip → Mention state contains secrets in plaintext; that's why it's guarded.

Azure All Azure questions Roadmap: AKS & Azure DevOps

More on CI/CD and IaC