Complete the code to specify the backend type for Azure Storage in Terraform.
terraform {
backend "[1]" {
resource_group_name = "myResourceGroup"
storage_account_name = "mystorageaccount"
container_name = "tfstate"
key = "terraform.tfstate"
}
}The backend type for Azure Storage in Terraform is azurerm. This tells Terraform to use Azure Blob Storage for state files.
Complete the code to specify the Azure Storage container name for the backend.
terraform {
backend "azurerm" {
resource_group_name = "myResourceGroup"
storage_account_name = "mystorageaccount"
container_name = "[1]"
key = "terraform.tfstate"
}
}The container name is where the Terraform state file is stored in Azure Blob Storage. 'tfstate' is a common and valid container name.
Fix the error in the backend configuration by completing the missing key name.
terraform {
backend "azurerm" {
resource_group_name = "myResourceGroup"
storage_account_name = "mystorageaccount"
container_name = "tfstate"
[1] = "terraform.tfstate"
}
}The correct key to specify the state file name in the Azure backend is key. This tells Terraform the name of the state file inside the container.
Fill both blanks to complete the backend configuration with correct resource group and storage account names.
terraform {
backend "azurerm" {
resource_group_name = "[1]"
storage_account_name = "[2]"
container_name = "tfstate"
key = "terraform.tfstate"
}
}The resource group name and storage account name must match the actual Azure resources. 'myResourceGroup' and 'mystorageaccount' are valid example names.
Fill all three blanks to complete the backend configuration with correct container name, key, and resource group name.
terraform {
backend "azurerm" {
resource_group_name = "[1]"
storage_account_name = "mystorageaccount"
container_name = "[2]"
key = "[3]"
}
}The resource group name is 'myResourceGroup', the container name is 'tfstate', and the key (state file name) is 'terraform.tfstate'. These are standard names used in Azure Storage backend configuration.