Error: Incompatible provider version

Hi

New to Terraform, trying to learn. However, I cannot really get started. Installation ok. Terraform as Terraform seems to work. In a way.

I installed the latest version, 0.13.4 and tried to create a very simple code.

Main.tf:


resource “azurerm_resource_group” “a_test_group” {
name = “test_group”
location = “West Europe”
}

Versions.tf:


terraform {
required_providers {
azure = {
source = “terraform-providers/azure”
}
azurerm = {
source = “hashicorp/azurerm”
version = “2.32.0”
}
}
required_version = “>= 0.13”
}

However, when issuing terraform init I get the following:

Initializing the backend…

Initializing provider plugins…

  • Using previously-installed hashicorp/azurerm v2.32.0
  • Finding latest version of terraform-providers/azure…

Error: Incompatible provider version

No compatible versions of provider
registry.terraform.io/terraform-providers/azure were found.

I have tried to install older versions as well, but that does not work either, just other errors. I’m stuck here, been trying to solve the problems for hours, and really need help.

Any idea?

Best regards
Jan B.

Hi @jaberger,

This “azure” provider was archived long ago in favor of the (relatively) new “azurerm” provider which uses the Azure Resource Management API. The “azure” provider is therefore compatible only with Terraform 0.11 and earlier, because it was archived before the plugin protocol changes in Terraform 0.12.

On the plus side, it does seem like you were already trying to use the azurerm provider here – the resource you declared belongs to that provider – so I think you could just remove the azure provider requirement declaration altogether:

terraform {
  required_version = “>= 0.13”

  required_providers {
    azurerm = {
      source = “hashicorp/azurerm”
      version = “2.32.0”
    }
  }
}

Hi @apparentlymart

Thanks a lot! It works! :smile:

In fact I did try to remove the “azure” provider, but it didn’t work. I suspect it might be because I had the “required version” line at the end.

Thanks for your help!

Have a nice day!

Best regards
Jan B