Insufficient features blocks issue on modules

Hello,

I am facing the an issue with a single provider config for “azure” even though I added the empty features block. My provider configuration file looks as below:

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

provider "azurerm" {
  # Configuration options
  features {}

}

I am still getting the below error
Error: Insufficient features blocks

│ on line 0:
│ (source code not available)

│ At least 1 “features” blocks are required.

Please let me know if there is anything wrong in this configuration and if so how to resolve this. Any help is much appreciated.

Hi rrachitha,
did you manage the problem?
The same issue in my code with a slight difference - I have 2 providers - “microsoft/azuredevops” and “hashicorp/azurerm”
normally (previously worked with azuredevops) the first provider doesn’t accept any features in provider block:

Error: Unsupported block type
│
│   on modules\ADO\provider.tf line 13, in provider "devops":
│   13:   features {}
│
│ Blocks of type "features" are not expected here.

when I’m removing features block - then I get:

╷
│ Error: Insufficient features blocks
│
│   on <empty> line 0:
│   (source code not available)
│
│ At least 1 "features" blocks are required.

WTF???

my providers looks like:

terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = ">= 3.2.0"
    }
  }
}

provider "azurerm" {
  features {
    log_analytics_workspace {
      permanently_delete_on_destroy = true
    }
    resource_group {
      prevent_deletion_if_contains_resources = true
    }
    key_vault {
      purge_soft_delete_on_destroy               = true
      purge_soft_deleted_secrets_on_destroy      = true
      purge_soft_deleted_certificates_on_destroy = true
    }
  }
  skip_provider_registration = true
}

and

terraform {
  required_providers {
    devops = {
      source  = "microsoft/azuredevops"
      version = ">= 0.2.1"
    }
  }
}

provider "devops" {
  org_service_url       = var.ado_organization_url
  personal_access_token = var.ado_pat
}

and versions are:

Terraform v1.1.9
on windows_386
+ provider registry.terraform.io/hashicorp/azurerm v3.3.0
+ provider registry.terraform.io/hashicorp/random v3.1.3
+ provider registry.terraform.io/microsoft/azuredevops v0.2.1

I’m slowly suspecting that I’m in a clash between: validation module on terraform is asking me for features blok on azuredevops provider block and azuredevops validating the code is giving me error to remove that features block.
Or anybody can please point me where I’m making a mistake…?

(searching rest of a code for words provider/providers/etc… is not giving me any other matches - read that as there is no other places with provider definitions.)