A. Terraform will ignore the backend and use local state
B. Terraform will create the storage account automatically
C. Terraform will initialize and connect to the Azure Storage backend to manage state
D. Terraform will fail because the container name is missing
Solution
Step 1: Understand terraform init with backend
terraform init reads backend config and connects to remote storage for state management.
Step 2: Check config completeness
All required fields (storage_account_name, container_name, key) are present, so initialization succeeds.
Final Answer:
Terraform will initialize and connect to the Azure Storage backend to manage state -> Option C
Quick Check:
terraform init + valid backend config = connect to remote state [OK]
Hint: terraform init connects backend if config is complete [OK]
Common Mistakes:
Assuming terraform creates storage account or container
Thinking missing container name causes failure here
Believing backend is ignored without explicit flag
4. You configured your Terraform backend with Azure Storage but get this error on terraform init: "Error: storage account name must be between 3 and 24 characters, and use only numbers and lowercase letters." What is the likely cause?
medium
A. The storage_account_name contains uppercase letters or invalid characters
B. The container_name is missing in the backend block
C. The key value is too long
D. Terraform version is outdated
Solution
Step 1: Analyze error message details
The error states storage account name rules: length 3-24, only numbers and lowercase letters.
Step 2: Identify cause from options
The storage_account_name contains uppercase letters or invalid characters matches the error cause: invalid characters or uppercase letters in storage_account_name.
Final Answer:
The storage_account_name contains uppercase letters or invalid characters -> Option A
Quick Check:
Storage account name rules violated = The storage_account_name contains uppercase letters or invalid characters [OK]
Hint: Storage account name must be 3-24 lowercase letters/numbers [OK]
Common Mistakes:
Ignoring case sensitivity in storage account name
Assuming container_name missing causes this error
Blaming Terraform version without checking config
5. You want to share Terraform state securely among your team using Azure Storage backend. Which combination of settings ensures state locking and encryption at rest?
hard
A. Use backend "azurerm" with storage_account_name, container_name, key; enable blob storage versioning and Azure Storage encryption
B. Use backend "azurerm" with storage_account_name and key only; disable container access control
C. Use backend "azurerm" with container_name and key only; enable public access to container
D. Use backend "azurerm" with storage_account_name, container_name, key; disable encryption for faster access
Solution
Step 1: Identify required backend config for state sharing
Storage account name, container name, and key are needed to locate the state file.
Step 2: Ensure state locking and encryption
Azure Blob Storage supports state locking via blob leases and encryption at rest by default; enabling versioning adds safety.
Final Answer:
Use backend "azurerm" with storage_account_name, container_name, key; enable blob storage versioning and Azure Storage encryption -> Option A