Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provider 1.26.0 breaks Azure Government Use #3312

Closed
rohrerb opened this issue Apr 26, 2019 · 8 comments · Fixed by #3313
Closed

Provider 1.26.0 breaks Azure Government Use #3312

rohrerb opened this issue Apr 26, 2019 · 8 comments · Fixed by #3313

Comments

@rohrerb
Copy link
Contributor

rohrerb commented Apr 26, 2019

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.

@katbyte
Copy link
Collaborator

katbyte commented Apr 26, 2019

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

@rohrerb
Copy link
Contributor Author

rohrerb commented Apr 26, 2019

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

@katbyte
Copy link
Collaborator

katbyte commented Apr 26, 2019

@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
}

@katbyte
Copy link
Collaborator

katbyte commented Apr 26, 2019

@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.

@rohrerb
Copy link
Contributor Author

rohrerb commented Apr 26, 2019

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.

@ghost
Copy link

ghost commented May 9, 2019

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 ...

@PeterWeiler
Copy link

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

@ghost
Copy link

ghost commented May 26, 2019

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!

@ghost ghost locked and limited conversation to collaborators May 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants