Open Eslam10 opened 2 years ago
@Eslam10 Thanks for your feedback. but for UserAssigned Identity. it is a by-design that does not set the principal property. because we can pass more than one UserAssigned id and each of them has its own principal, so we cannot set only one of identity.principal_id
@wuxu92 , thanks for the reply.
I am not sure how can we assign more than one user managed identity to the same policy assignment, this gives me the below error.
Message="The policy assignment 'test-policy-assignment' request is invalid. One and only one identity can be specified. You cannot specify both user assigned and system assigned identities, nor can you specify more than one user assigned identity
.
I believe this identity_ids
argument should be a string not a list ? I will open a separate issue for this error.
Is there an existing issue for this?
Community Note
Terraform Version
1.1.2
AzureRM Provider Version
3.28.0
Affected Resource(s)/Data Source(s)
azurerm_subscription_policy_assignment
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Attribute reference
identity.principal_id
should have the value of the user assigned managed identityprincipal_id
.This is working properly for the
SystemAssigned
managed identity type but not for theUserAssigned
.This
principal_id
attribute reference will be used in the same code for assigning the required role of the policy assignment usingazurerm_role_assignment
TF resource.Actual Behaviour
Attribute reference
identity.principal_id
is empty.Steps to Reproduce
azurerm_subscription_policy_assignment
resource.UserAssigned
managed identity type.resource.identity.principal_id
value or use it on another resource.Important Factoids
No response
References
No response