-
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_role_assignment forces replacement after azurerm_storage_share resource_manager_id is corrected #21798
Comments
@enorlando Sorry for this unexpected breaking change.. Alternatively, you can use the Whilst, since what #21638 does is to fix the incorrect storage share id to the real azure resource id. So I'm wondering whether your existing role assignment do take effect in fact? |
@magodo That is what we have done in the interim however it is not the best approach The existing role assignment has indeed been working prior to this provider change. If I apply the diff, it updates the state with the correct merged |
@enorlando That is because the portal is using the wrong resource id: (including the URL it uses to list the role assignments) You can get the newly assigned roles in the correct id by tools like az cli: |
@magodo so this is a bug in the UI of the azure portal? I assume that until that is fixed we need to use |
i'm not sure it's a bug in the UI. What we noticed was the users lost access to the share when Terraform assigned the scope to Now we're forced to do the hard coded path above |
I also opened up a ticket with Microsoft when we ran into this exact same issue with using the resource_manager_id in azurerm v3.56.0 (or newer), and also our users lost connectivity. Microsoft, in their examples, show that we should be using |
@magodo may you she some light on this please? Thanks |
Thank you @dvansteenburg for providing more context, and sorry for the inconvinience! I've submit a PR to revert #21645. Since this file share is a data plane resource, its resource manager ID is kind of defined by convention. For us, we always regard Swagger as the source of trueth. While the Azure RBAC is using another form. Therefore, I've submit an issue towards the Swagger repo for this: Azure/azure-rest-api-specs#24568 |
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. |
Is there an existing issue for this?
Community Note
Terraform Version
1.4.6
AzureRM Provider Version
3.56
Affected Resource(s)/Data Source(s)
azurerm_role_assignment
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
No changes. Your infrastructure matches the configuration.
Actual Behaviour
forces replacement
Steps to Reproduce
terraform plan
Important Factoids
After #21638 was merged and provider was updated we encounter this issue. We can no longer use the resource_manager_id of the azurerm_storage_share when this is the scope and have to use the hard coded path like below to avoid the recreation of the resource
"/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Storage/storageAccounts/xxx/fileServices/default/fileshares/shares"
References
No response
The text was updated successfully, but these errors were encountered: