-
Notifications
You must be signed in to change notification settings - Fork 194
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
--include-role-assignment not working #573
Comments
Repro:
resource "azurerm_resource_group" "res-0" {
location = "westeurope"
name = "my-rg"
} |
Also this command returns all the info about the role assignment
|
Thank you very much for the prompt support! |
The role assignment is still missing after the fix, if the resource group is empty, in that case the list of resources contains the rg but not the ra.
On the other side I confirm the same role assignment is exported when the resource group is not empty, so the root cause has been identified somehow. |
I believe the issue is that, when the resource group is empty, In fact, the following command works: $ aztfexport query --arg-authorization-scope-filter "AtScopeAboveAndBelow" --include-role-assignment --arg-table "AuthorizationResources" --output-dir tf_test -n "properties.scope == '/subscriptions/53695a56-bab1-42e1-b477-56901ef22e79/resourcegroups/my-rg'" The output file When resources are present, Fundamentally, a resource group belongs to $ azlist -s '53695a56-bab1-42e1-b477-56901ef22e79' --extension Microsoft.Authorization/roleAssignments --table ResourceContainers 'name == "my-rg"'
/subscriptions/53695a56-bab1-42e1-b477-56901ef22e79/resourceGroups/my-rg
/subscriptions/53695a56-bab1-42e1-b477-56901ef22e79/resourceGroups/my-rg/providers/Microsoft.Authorization/roleAssignments/7706404e-2d54-48c6-ba34-08ec3b0d5335 |
@giuliohome You're right! I missed the case that an empty resource group case. |
I have tried
and I've found no role assignment in the generated
main.tf
while they are present and I can see them from
az role assignment list --resource-group my-rg
and they are directly assigned to the resource group.The text was updated successfully, but these errors were encountered: