Open keesvandenhoekict opened 2 years ago
@jackofallops, would this be a matter of adding 3 levels of scoping to azurerm_role_assignment
like done in #10890?
Scopes:
"providers/Microsoft.Billing/billingAccounts/abc-123"
"providers/Microsoft.Billing/billingAccounts/abc-123/billingProfiles/def-456"
"providers/Microsoft.Billing/billingAccounts/abc-123/billingProfiles/def-456/invoiceSections/ghi-789"
Ran into this today. I wonder if the validation should be relaxed here. There is already a function: ParseAzureResourceIDWithoutSubscription
- this could be sufficient validation for role assignments - rather than finding every case of resource ids without subscription and implementing separate role assignment validation for them.
An example of another entity that does not have a subscription but I think should support role assignment are tenants.
e.g. I think that this should work:
resource "azurerm_role_assignment" "create_global_admin_role_on_tenant" {
scope = "tenants/<TENANT ID>"
role_definition_name = "Global administrator"
principal_id = azurerm_user_assigned_identity.example.principal_id
}
Any thoughts on this issue? This is still a blocker today
For anyone else reading this, I worked around the issue by creating a group with the appropriate billing permissions and added identities such as service principals to said group
For anyone else reading this, I worked around the issue by creating a group with the appropriate billing permissions and added identities such as service principals to said group
thoug not required adding a sample code for ur workaround would be nice
why not use azuread_directory_role_assignment instead of azurerm_role_assignment ? It seems azuread is better suited
In case someone ends up on that issue while looking for a solution, here is a related issue with a workaround: https://github.com/Azure/terraform-provider-azapi/issues/400
Community Note
Description
This request is to add support in azurerm_role_assignment to support billing role assignment for MCA(Microsoft Customer Agreement) customers. The equivalent change for Enterprise Agreement customers (enrollment accounts) has been realised in #10547
New or Affected Resource(s)
Potential Terraform Configuration
References