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 →
- Backend
use_azuread_auth = true; grantStorage Blob Data Contributoron the container to the pipeline identity only az storage account update --allow-shared-key-access false- Enable blob versioning and soft delete;
CanNotDeletelock on the account - Private Endpoint (with private agents) or network rules limiting access
- 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.
More on CI/CD and IaC
Design a GitHub Actions pipeline that builds an image, pushes to ACR and deploys to AKS with no secrets.IntermediateYour 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?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