hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.58k stars 4.62k forks source link

azurerm >= 3.15.0: Error: parsing "/subscriptions/…/resourceGroups/…/providers/Microsoft.ServiceBus/namespaces/…/AuthorizationRules/…": parsing segment "staticAuthorizationRules": expected the segment "AuthorizationRules" to be "authorizationRules" #17720

Closed alexs77 closed 2 years ago

alexs77 commented 2 years ago

Is there an existing issue for this?

Community Note

Terraform Version

1.2.5

AzureRM Provider Version

3.15.0

Affected Resource(s)/Data Source(s)

azurerm_servicebus_namespace_authorization_rule

Terraform Configuration Files

resource "azurerm_servicebus_namespace_authorization_rule" "…" {
  name         = local.name
  namespace_id = azurerm_servicebus_namespace.….id

  listen = true
  send   = true
}

Debug Output/Panic Output

Error: parsing "/subscriptions/…/resourceGroups/…/providers/Microsoft.ServiceBus/namespaces/…/AuthorizationRules/…": parsing segment "staticAuthorizationRules": expected the segment "AuthorizationRules" to be "authorizationRules"

  with module.service_bus[0].azurerm_servicebus_namespace_authorization_rule.…,
  on modules/service_bus/service_bus.tf line 13, in resource "azurerm_servicebus_namespace_authorization_rule" "…":
  13: resource "azurerm_servicebus_namespace_authorization_rule" "…" {

Expected Behaviour

No error. Same code works fine with AzureRM provider 3.14.0.

Actual Behaviour

Doesn't work.

Steps to Reproduce

Important Factoids

No response

References

No response

alexs77 commented 2 years ago

Just to make it clear: This is a regression/change from v3.14.0. It worked with 3.14.0.

vhloba commented 2 years ago

The same issue with v3.15.0 v3.14.0 works well.

alexs77 commented 2 years ago

The same issue with v3.15.0 v3.14.0 works well.

That's what I meant :)

enorlando commented 2 years ago

We are also encountering the same issue when using v3.15.0 of the provider

alexs77 commented 2 years ago

Still present with v3.15.1 of the provider.

biggles007 commented 2 years ago

There was a similar issue with another resource a while back (https://github.com/hashicorp/terraform-provider-azurerm/issues/15549) and it was caused when the SDK was changed. I know the SDK on the Servicebus resources was changed recently so could be related.

Marcus-James-Adams commented 2 years ago

Error: parsing "/subscriptions/..../resourceGroups/..../providers/Microsoft.ServiceBus/namespaces/.../AuthorizationRules/readwrite": parsing segment "staticAuthorizationRules": expected the segment "AuthorizationRules" to be "authorizationRules" │ │ with azurerm_servicebus_namespace_authorization_rule.msgprocs-readwrite, │ on servicebus.tf line 26, in resource "azurerm_servicebus_namespace_authorization_rule" "msgprocs-readwrite": │ 26: resource "azurerm_servicebus_namespace_authorization_rule" "msgprocs-readwrite" { │ ╵

C:\repo\cloud_infrastructure\projects\platform\c17\UK_South\3.7.msgprocs>terraform version Terraform v1.2.1 on windows_amd64

  • provider registry.terraform.io/cloudflare/cloudflare v3.20.0
  • provider registry.terraform.io/hashicorp/azuread v2.26.1
  • provider registry.terraform.io/hashicorp/azurerm v3.16.0

Still occurring on 3.16.0

nomaster commented 2 years ago

Also still occurring on 3.17.0

Vercidium commented 2 years ago

Hi all,

Is there a workaround available for this? I attempted to change the version specified in main.tf from >= 2.26.0 to =3.14.0 like so:

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

However my terraform init task in my Azure pipeline still says it's searching for >= 2.26.0 and installs the latest version:

Initializing provider plugins...
Finding hashicorp/azurerm versions matching ">= 2.26.0"...
Installing hashicorp/azurerm v3.17.0...
Installed hashicorp/azurerm v3.17.0 (self-signed, key ID 34365D9472D7468F)
alexs77 commented 2 years ago

However my terraform init task in my Azure pipeline still says it's searching for >= 2.26.0 and installs the latest version:

Try terraform init -upgrade. Despite the name being "upgrade", terraform init will then also happily do a downgrade, when you specify -upgrade.

wiebeck commented 2 years ago

This seems to be fixed with provider version 3.19.0 finally. The changelog doesn't mention a bigfix for this but I assume the update of the Azure SDK fixed it.

Hooray!

tombuildsstuff commented 2 years ago

Fixed in v3.19.0

github-actions[bot] commented 1 year ago

This functionality has been released in v3.27.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

github-actions[bot] commented 1 year ago

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.