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
In Azure Bicep, what is the purpose of the `@description` decorator?
Answer: Adds human-readable documentation to parameters and outputs
The `@description` decorator adds metadata documentation strings to parameters, variables, and outputs in Bicep files.
Which Terraform command is used to preview infrastructure changes without applying them?
Answer: terraform plan
`terraform plan` generates an execution plan showing what changes Terraform will make without actually applying them.
When using Azure Resource Manager (ARM) templates, what does the `dependsOn` property control?
Answer: Explicit resource deployment ordering when implicit dependencies are insufficient
`dependsOn` explicitly defines deployment dependencies so ARM waits for specified resources to finish before deploying the dependent resource.
What is the primary benefit of using Terraform workspaces in a multi-environment IaC strategy?
Answer: They enable managing multiple distinct state files from the same configuration
Terraform workspaces maintain separate state files for each workspace, letting the same configuration manage dev, staging, and prod environments independently.
In Azure DevOps pipelines, which built-in variable contains the source branch name that triggered the pipeline?
Answer: $(Build.SourceBranchName)
`$(Build.SourceBranchName)` contains the branch or tag name (without refs/heads/) that triggered the current pipeline run.
What does the `terraform taint` command (or its modern equivalent `terraform apply -replace`) do?
Answer: Marks a resource as corrupted so it will be destroyed and recreated on next apply
Tainting (or `-replace`) marks a specific resource for destruction and recreation on the next `terraform apply`, useful when a resource is in a broken state.
Which Azure Bicep feature allows you to deploy the same resource configuration to multiple instances using a single declaration?
Answer: resource loops using `for` expressions
Bicep supports `for` loops in resource declarations to create multiple instances of a resource from an array or range without repeating code.