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

Upgrade to 1.32.0 breaks storage table #3924

Closed
hbuckle opened this issue Jul 25, 2019 · 7 comments
Closed

Upgrade to 1.32.0 breaks storage table #3924

hbuckle opened this issue Jul 25, 2019 · 7 comments

Comments

@hbuckle
Copy link
Contributor

hbuckle commented Jul 25, 2019

After upgrading to 1.32.0 refreshing an existing storage table fails with the error Expected the Table Name to be in the format 'Tables('name')' but got "test"
Creating a new storage table from scratch works

Repro: apply the following config

provider "azurerm" {
  version = "= 1.31.0"
}

resource "azurerm_resource_group" "test" {
  name     = "test"
  location = "uksouth"
}

resource "random_string" "test" {
  length  = 24
  upper   = false
  lower   = true
  number  = true
  special = false
}

resource "azurerm_storage_account" "test" {
  name                     = random_string.test.result
  resource_group_name      = azurerm_resource_group.test.name
  location                 = azurerm_resource_group.test.location
  account_tier             = "Standard"
  account_replication_type = "LRS"
}

resource "azurerm_storage_table" "test" {
  name                 = "test"
  resource_group_name  = azurerm_resource_group.test.name
  storage_account_name = azurerm_storage_account.test.name
}

The change the provider version to 1.32.0 and run apply again:

terraform apply -auto-approve
random_string.test: Refreshing state... [id=none]
azurerm_resource_group.test: Refreshing state... [id=/subscriptions/xxx/resourceGroups/test]
azurerm_storage_account.test: Refreshing state... [id=/subscriptions/xxx/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/6zzpdiqsisr4vnw671hm32xf]
azurerm_storage_table.test: Refreshing state... [id=https://6zzpdiqsisr4vnw671hm32xf.table.core.windows.net/test]

Error: Expected the Table Name to be in the format `Tables('name')` but got "test"
terraform -v
Terraform v0.12.5
@kecirlotfi
Copy link

Hello
I confirm this issue on our side.
Can some one update the documentation please or help us to sort out this issue?
Thanks in advance.

@Kdecherf
Copy link

The issue seems to be related to #3834

The construction of the id is not the same between 1.31 and 1.32. On the previous version the id is following the form id=https://{storageaccount}.table.core.windows.net/{tablename} whereas the new SDK uses this one: id=https://{storageaccount}.table.core.windows.net/Tables('{tablename}').

Renaming the id in the tfstate or removing the whole resource and importing it seem to fix the issue seen during terraform plan. I don't know if it's the recommended way to work around this issue though :)

@t0klian
Copy link
Contributor

t0klian commented Jul 26, 2019

The issue seems to be related to #3834

The construction of the id is not the same between 1.31 and 1.32. On the previous version the id is following the form id=https://{storageaccount}.table.core.windows.net/{tablename} whereas the new SDK uses this one: id=https://{storageaccount}.table.core.windows.net/Tables('{tablename}').

Renaming the id in the tfstate or removing the whole resource and importing it seem to fix the issue seen during terraform plan. I don't know if it's the recommended way to work around this issue though :)

No it won't work) I tried it and got the same 'Expected the Table Name to be in the format Tables('blablabla') but got "blablabla"' error when had been trying to import resource back

@jungopro
Copy link

hitting the same issue. i can help with testing if needed

@mbfrahry
Copy link
Member

Hey all, thanks for opening this issue. I just merged the fix for this that will go out in the next release. Going to close this down but feel free to reopen if you continue to have issues after the next release goes out.

@ghost
Copy link

ghost commented Aug 1, 2019

This has been released in version 1.32.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.32.1"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Aug 29, 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 👉 hashibot-feedback@hashicorp.com. Thanks!

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

No branches or pull requests

7 participants