-
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.NAME.id returns an unpathed resource ID #1554
Comments
hi @Supermathie Thanks for opening this issue :) The ID of the Storage Container matches the name since this is the identifier used to access it within Azure; there's no fully scoped path that I'm aware of (technically the Container name is used internally within the SDK to populate As far as I'm aware roles can only be scoped to full resources in Azure, rather than components of resources (e.g. to a Storage Account rather a Storage Container). Would you be able to take a look and see if scoping to the Storage Account works for you? Thanks! |
I wasn't 100% sure but I figured since EVERY OTHER resource (I've found) returns the fully qualified path from the
It works but isn't useful, but that's because #1538 needs to be added first before I can actually add anything to the container. (I can't use
According to the docs:
so I just tried adding the builtin Contributor via the GUI and it worked! Listing the new assignments via {
"additionalProperties": {},
"canDelegate": null,
"id": "/subscriptions/16b9f5dc-3276-4b32-91b2-xxxx/resourceGroups/xxxx-dev-michael-meta/providers/Microsoft.Storage/storageAccounts/xxxxdevmichaelmeta/blobServices/default/containers/assets/providers/Microsoft.Authorization/roleAssignments/0001d545-32b1-4886-8386-69f9b6382148",
"name": "0001d545-32b1-4886-8386-69f9b6382148",
"principalId": "85967648-3a1c-45c0-b14b-df1fb045ecf3",
"principalName": "27576c5d-8b57-4d48-9a14-c783aff59d29",
"resourceGroup": "xxxx-dev-michael-meta",
"roleDefinitionId": "/subscriptions/16b9f5dc-3276-4b32-91b2-xxxx/providers/Microsoft.Authorization/roleDefinitions/ba92f5b4-2d11-453d-a403-e96b0029c9fe",
"roleDefinitionName": "Storage Blob Data Contributor (Preview)",
"scope": "/subscriptions/16b9f5dc-3276-4b32-91b2-xxxx/resourceGroups/xxxx-dev-michael-meta/providers/Microsoft.Storage/storageAccounts/xxxxdevmichaelmeta/blobServices/default/containers/assets",
"type": "Microsoft.Authorization/roleAssignments"
}, That actually helps - it means that the role assignment works with a scope line of: scope = "${azurerm_storage_account.app.id}/blobServices/default/containers/${azurerm_storage_container.assets.id}" … which is not very intuitive … Given all of the above I propose that the full string:
would be a good candidate for That would mean that the very intuitive: resource "azurerm_role_assignment" "role_assignment" {
scope = "${azurerm_storage_container.test.id}"
…
} works! |
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! |
Community Note
Terraform Version
Terraform v0.11.7
Affected Resource(s)
Terraform Configuration Files
Debug Output
(available on request)
Panic Output
Expected Behavior
azurerm_storage_container.NAME.id
should return a complete path to the resource IDActual Behavior
azurerm_storage_container.NAME.id
returns only the storage container name:Steps to Reproduce
terraform apply
Important Factoids
Ø
References
Ø
The text was updated successfully, but these errors were encountered: