Azurerm Features block error on Terraform v0.13.2

When features block is not added on Azurerm provider, below error is received on executing terraform plan command:

Error: “features”: required field is not set

After adding features block as below, terraform init command gives the error:

terraform {
required_providers {
azurerm = {
source = “hashicorp/azurerm”
version = “2.26.0”
features {}
}
}
}

There are some problems with the configuration, described below.

The Terraform configuration must be valid before initialization so that
Terraform can determine which modules and providers need to be installed.

Error: Missing key/value separator

on providers.tf line 17, in terraform:
14: azurerm = {
15: source = “hashicorp/azurerm”
16: version = “2.26.0”
17: features {}

Expected an equals sign (“=”) to mark the beginning of the attribute value.

Please suggest if i’m incorrect on syntax here or if there is a workaround for this.

1 Like

The features argument needs to be set in the provider configuration block, not the required_providers entry for azurerm. Try a config that looks like this:

terraform {
  required_providers {
    azurerm = {
      source = "hashicorp/azurerm"
      version = "2.26.0"
    }
  }
}

provider "azurerm" {
  features {}
}
1 Like

Hi Alisdair,

I had a confusion from the reference of How to use this provider of Azurerm, misunderstood that required_providers is replacement for providers block.
I have added the separate provider block again for Azurerm for its configurations and its working. Thank you for pointing this out.

Thanks for pointing out that potentially-confusing part of the Terraform Registry UI, @gautam-ramini!

The intent of those instructions is to show that the version argument in particular is now specified via required_providers, not that all of the settings in there have moved. However, I can see how it’s confusing since the “<= 0.12” example doesn’t show any other arguments inside the provider block to illustrate that they don’t come along with the change.

I’ll forward this feedback to the Terraform Registry team to see if they would like to change the UI to clarify this somehow. Thanks again!

@apparentlymart Yes, exactly! If the UI could be updated, might help others too not to have this confusion. Thank you for forwarding the feedback!