Terraform-provider-azurerm: Provider 1.26.0 breaks Azure Government Use

Created on 26 Apr 2019  ยท  8Comments  ยท  Source: terraform-providers/terraform-provider-azurerm

Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Affected Resource(s)

Terraform v0.11.13

  • provider.azurerm v1.26.0

Terraform Configuration Files

Fails

provider "azurerm" {
  subscription_id = "<sub_id>"

  version = "=1.26.0"
}

resource "azurerm_resource_group" "test" {
  name     = "test1234"
  location = "usgovvirginia"
}

Works

provider "azurerm" {
  subscription_id = "<sub_id>"

  version = "=1.25.0"
}

resource "azurerm_resource_group" "test" {
  name     = "test1234"
  location = "usgovvirginia"
}

Debug Output

Error: Error running plan: 1 error(s) occurred:

  • provider.azurerm: Error ensuring Resource Providers are registered: Cannot register provider Microsoft.Cdn with Azure Resource Manager: resources.ProvidersClient#Register: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="InvalidResourceNamespace" Message="The resource namespace 'Microsoft.Cdn' is invalid.".

Steps to Reproduce

`Using the above hcl change the provider version and run a init and plan to see the error when using newest provider.

bug provider regression

All 8 comments

Hi @rohrerb,

I'm sorry that 1.26 has broken for you. Without access to Azure Gov Cloud I am not going to be able to reproduce this and looking at the diff between v1.25 and v1.26 nothing is jumping out. Is there anything unique about your environment such as a proxy that is worth noting?

The resource namespace Microsoft.Cdn was added to the provider quite some time ago and the only thing regarding registration we have changed is ensuring the same senders are used for auth and client requests.

Could you possibly share with us the full debug log for both 1.25 and 1.26?

Thanks

Hi @katbyte ,

Microsoft.Cdn has been around but its not a valid provider in Azure Government yet.

debug gist > https://gist.github.com/rohrerb/aa8bc1a37e37045d0ef81cbb420521ea

Seems error is coming from terraform.EvalConfigProvider

Thank you

@rohrerb,

So I can now see we are trying to register the providers in both logs, and in 1.26 we fixed the error handling logic there actually throw up errors if provider registration failed ๐Ÿ˜… so we were silently ignoring these errors before. You can skip provider registration if you'd like to use 1.26 via command line while we get a fix out the door:

ARM_SKIP_PROVIDER_REGISTRATION=true terraform apply

or within the provider block:

provider "azurerm" {
  subscription_id = "<sub_id>"

  version = "=1.26.0"
  skip_provider_registration = true
}

@rohrerb,

I plan to release v1.27.1 tomorrow with a fix for this. However that will also have support for terraform .12, if there is a need we can cut a v1.26.1 release that also has the fix without the .12 support. Just let us know, thanks for you patience.

Hi @katbyte, We use the work around until v1.27.1 is released at some point today.

Appreciate your help and quick turn around on this.

This has been released in version 1.27.1 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 1.27.1"
}
# ... other configuration ...

Hi @katbyte,

I'm seeing this same issue in provider version 1.28.0

The workaround ( skip_provider_registration = true) gets past the errors, but seems like the fix didn't get into the newer build

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error ๐Ÿค– ๐Ÿ™‰ , please reach out to my human friends ๐Ÿ‘‰ [email protected]. Thanks!

Was this page helpful?
0 / 5 - 0 ratings