Interview Prep/Azure/CI/CD and IaC

How do you manage secrets needed by Terraform (like a DB admin password)?

IntermediateScenarioCI/CD and IaC
Answer

Situation read → Avoid passing secrets around; generate and store in Key Vault, or avoid passwords.

What I'd do →

  1. Use random_password to generate, write to Key Vault with azurerm_key_vault_secret, consumers read from Key Vault
  2. Better: Entra-only auth on Azure SQL/PostgreSQL so no admin password exists
  3. Mark variables sensitive = true; know they still land in state
  4. Use ephemeral resources/write-only arguments (Terraform 1.10+/1.11+) where the provider supports them to keep secrets out of state

Why → Every secret in variables ends up in logs, state or both unless you design against it.

Interview tip → Mention state encryption and access as the remaining risk.

Azure All Azure questions Roadmap: AKS & Azure DevOps

More on CI/CD and IaC