0
0
Terraformcloud~10 mins

Azure Storage backend in Terraform - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the backend type for Azure Storage in Terraform.

Terraform
terraform {
  backend "[1]" {
    resource_group_name  = "myResourceGroup"
    storage_account_name = "mystorageaccount"
    container_name       = "tfstate"
    key                  = "terraform.tfstate"
  }
}
Drag options to blanks, or click blank then click option'
Aazurerm
Blocal
Cgcs
Daws
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'aws' or 'gcs' as backend type for Azure Storage.
Using 'local' backend instead of cloud backend.
2fill in blank
medium

Complete the code to specify the Azure Storage container name for the backend.

Terraform
terraform {
  backend "azurerm" {
    resource_group_name  = "myResourceGroup"
    storage_account_name = "mystorageaccount"
    container_name       = "[1]"
    key                  = "terraform.tfstate"
  }
}
Drag options to blanks, or click blank then click option'
Atfstate
Bstatefiles
Cterraformstate
Dbackend
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase letters in container name.
Using invalid container names with spaces or special characters.
3fill in blank
hard

Fix the error in the backend configuration by completing the missing key name.

Terraform
terraform {
  backend "azurerm" {
    resource_group_name  = "myResourceGroup"
    storage_account_name = "mystorageaccount"
    container_name       = "tfstate"
    [1] = "terraform.tfstate"
  }
}
Drag options to blanks, or click blank then click option'
Astate_key
Bkey
Cfile_key
Dstate_file
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'state_file' or 'file_key' instead of 'key'.
Omitting the key property entirely.
4fill in blank
hard

Fill both blanks to complete the backend configuration with correct resource group and storage account names.

Terraform
terraform {
  backend "azurerm" {
    resource_group_name  = "[1]"
    storage_account_name = "[2]"
    container_name       = "tfstate"
    key                  = "terraform.tfstate"
  }
}
Drag options to blanks, or click blank then click option'
AmyResourceGroup
Bstorageaccount1
Cmystorageaccount
DresourceGroup1
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up resource group and storage account names.
Using uppercase letters in storage account name.
5fill in blank
hard

Fill all three blanks to complete the backend configuration with correct container name, key, and resource group name.

Terraform
terraform {
  backend "azurerm" {
    resource_group_name  = "[1]"
    storage_account_name = "mystorageaccount"
    container_name       = "[2]"
    key                  = "[3]"
  }
}
Drag options to blanks, or click blank then click option'
AmyResourceGroup
Btfstate
Cterraform.tfstate
Dstatecontainer
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing container name with resource group name.
Using incorrect key names.