Open Matioski opened 3 weeks ago
Thats interesting, I have recently just configured a module to use the azuread_service_principal_delegated_permission_grant
resoruce.
I applied a first run and it added the User.Read
successfully, I then needed to update that and add another claim value but on Terraform apply I also get:
ā Property cannot be updated: clientId
Here is a snippet of the resource I am using
resource "azuread_service_principal_delegated_permission_grant" "this" {
service_principal_object_id = azuread_service_principal.this.object_id
resource_service_principal_object_id = azuread_service_principal.msgraph.object_id
claim_values = flatten([for resource in var.required_resource_access : resource.resource_access[*].id])
}
hashicorp/azurerm provider: 4.4.0
Community Note
Terraform (and AzureAD Provider) Version
Terraform v1.9.7 on darwin_arm64
Affected Resource(s)
azuread_service_principal_delegated_permission_grant
Terraform Configuration Files
Debug Output
https://gist.github.com/Matioski/acd96ab3f722667f0be8fed402c06782
Panic Output
Expected Behavior
The azuread_service_principal_delegated_permission_grant should be updated and the clientId should not be sent in the body as per: https://learn.microsoft.com/en-us/graph/api/oauth2permissiongrant-update?view=graph-rest-1.0&tabs=http
Actual Behavior
ā unexpected status 400 (400 Bad Request) with error: Request_BadRequest: Property cannot be updated: clientId
as the request that is sent has this body:
{"@odata.type":"#microsoft.graph.oAuth2PermissionGrant","clientId":"","scope":"Directory.ReadWrite.All Application.ReadWrite.All Policy.Read.All Policy.ReadWrite.ApplicationConfiguration Synchronization.ReadWrite.All User.Read.All Group.ReadWrite.All"}
Steps to Reproduce
Create a azuread_service_principal_delegated_permission_grant and try tu update the claim_values.
terraform apply
Important Factoids
References
* #1511