-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
azurerm_storage_container: migrating from storage_account_name to storage_account_id forces replacement #27942
Comments
The same issue occurs with the azurerm_storage_share resource. The following example also forces a replacement.
|
Here's a quick fix until this is resolved:
|
We have also ran into the same issue (from the original post) and noticed that the container was destroyed in our lower environment. |
We are also seeing the |
you can re-import those Ressource, so that you dont have to re-create them.
The Important Part is to use the resource_manager_id, not the url. if you do a Plan before, you can see the current resource_manager_id and use it in case of Blob. in my Tests, the resource_manager_id shown on File Shares was incorrect. on Position 10 it was printed with "fileshares" instead of "shares" |
I have too many repos to adjust state in all environments and the other workaround was not enough as adding the account_id is enough to trigger a replacement. I will postpone this version, is there any plan to implement a proper fix in the code? |
@peruzzof - Same here... this "migration" will be pain in the ass. │ This property has been deprecated and will be replaced by |
Seriously, this should just work. |
I can confirm that re-importing using the resource_manager_id attribute value rather than the URL as specified in the documentation does correctly import the resource and clears the replacement. |
The only option we have now is remove from state file and reimport the storage container and storage share resoure? |
linking the PR that deprecated the |
Is there an existing issue for this?
Community Note
Terraform Version
1.9.8
AzureRM Provider Version
4.9.0
Affected Resource(s)/Data Source(s)
azurerm_storage_container
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
I expect that when we get promted by a warning that:
the
storage_account_nameproperty has been deprecated in favour of
storage_account_idand will be removed in version 5.0 of the Provider.
I then would expect that when we change from using thestorage_account_name
to thestorage_account_id
that it will not try to recreate the storage account but just plan with 0 changes.Actual Behaviour
When running a plan I get the message that the
azurerm_storage_account
has to be recreated because we have added thestorage_account_id
property and that we have removed thestorage_account_name
Steps to Reproduce
Create a new storage account and a new storage container where you use the
storage_account_name
property to reference the storage account. After the resources have been created, try to change from using thestorage_account_name
to thestorage_account_id
and observe the plan output.Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: