Infrastructure as Code Flashcards
7 cards from real AZ-400 practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 7 Infrastructure as Code flashcards as text
What is the purpose of Terraform's `lifecycle` block with `prevent_destroy = true`?
Answer: Causes Terraform to throw an error if a plan would destroy the resource
`prevent_destroy = true` makes Terraform fail with an error if any plan includes destruction of that resource, acting as a safety guard for critical infrastructure.
In Azure Bicep, how do you reference an output from a deployed module within the same Bicep file?
Answer: Using `moduleName.outputs.outputName`
After deploying a module with a symbolic name, you access its outputs using the dot notation `moduleName.outputs.outputName`.
Which Azure service provides a centralized registry for sharing and versioning private Bicep modules across an organization?
Answer: Azure Container Registry (ACR)
Azure Container Registry supports Bicep module registries, allowing teams to publish and consume versioned private modules using `br:` references.
What happens when you run `terraform apply` and the actual Azure resource state differs from the Terraform state file (state drift)?
Answer: Terraform detects the drift, shows the differences in the plan, and corrects it on apply
Terraform refreshes the state before planning, detects any drift between real infrastructure and the state file, and includes corrections in the apply plan.
In an Azure Pipelines YAML file, what is the effect of setting `condition: always()` on a pipeline step?
Answer: The step runs even if previous steps failed or were cancelled
`condition: always()` causes the step to execute regardless of whether previous steps succeeded, failed, or were cancelled—useful for cleanup steps.
When using Azure Policy with IaC deployments, what is the `DeployIfNotExists` effect used for?
Answer: Automatically remediating non-compliant resources by deploying required configurations
`DeployIfNotExists` triggers a remediation deployment to bring non-compliant resources into compliance by deploying required child resources or configurations.
What is the purpose of the `templateLink` property in an ARM template's linked template deployment?
Answer: Specifies a URI to an external ARM template to deploy as a nested resource
`templateLink` specifies the URI of an external ARM template (typically in Azure Blob Storage or GitHub) to be deployed as part of a modular linked template pattern.