I would like to use PowerAutomate to be able to remove the Security Role from the user (on any environment), unfortunately the action 'Edit_Environment_Role_Assignment' returns the following error:
The environment 'ENV_ID' is linked to a new CDS 2.0 instance. The operation 'POST/PROVIDERS/MICROSOFT.BUSINESSAPPPLATFORM/SCOPES/ADMIN/ENVIRONMENTS/MODIFYROLEASSIGNMENTS' is forbidden for linked environments.
So I would like to use REST API to be able to remove Security Role from the user.
I found this topic in the documentation:
https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/update-delete-entities-using-web-api#delete-a-single-property-value
Unfortunately, when I try to make such a query using HTTP blocks in PowerAutomate, I get a prompt:
Delete References directly is only valid for OneToManyEntityRelationship
QUERY:
{
"uri": "EnvLink/api/data/v9.1/systemusers(UserID)/systemuserroles_association/$ref",
"method": "DELETE",
"headers": {
"authorization": "*sanitized*",
"Content-Type": "application/json",
"Accept": "application/json",
"OData-MaxVersion": "4.0",
"OData-Version": "4.0"
},
"body": {
"@odata.id": " EnvLink/api/data/v9.1/roles(RoleID)"
}
}
Please help me to use PowerAutomate to remove Security Role from a user