Description
Feature Request
I am creating a Terraform resource to manage RoleManagementPolicies through terraform. I am looking to use the RoleManagementPoliciesClient to list role management policies for a given scope
and roleDefinitionId
to then load the existing RoleManagementPolicy. However, the NewListForScopePager
does not allow specifying a Filter
.
There is Filter
support on other List methods and you are able to filter directly on the REST method (see: https://docs.microsoft.com/en-us/rest/api/authorization/privileged-role-policy-rest-sample)
https://management.azure.com/providers/Microsoft.Subscription/subscriptions/{{subscription-id}}/providers/Microsoft.Authorization/roleManagementPolicies?api-version=2020-10-01-preview&filter=roleDefinitionId eq '/subscriptions/********-****-****-****-************/providers/Microsoft.Authorization/roleDefinitions/********-****-****-****-************'
This will return you the roleManagementPolicy for the request subscription and role.
Could support for Filter
be added to this method?
EDIT
I had originally quoted the above API call which is incorrect, the correct call is to retreive a RoleManagementPolicyAssignment for a scope/roleDefinitionId, this can be acheived with the following API call
https://management.azure.com/subscriptions/{{subscription-id}}/providers/Microsoft.Authorization/roleManagementPolicyAssignments?api-version=2020-10-01&$filter=roleDefinitionId eq '/subscriptions/********-****-****-****-************/providers/Microsoft.Authorization/roleDefinitions/********-****-****-****-************'
So this applies to the RoleManagementPolicyAssignmentsClient
and would request the addition of the Filter
property.
Have tested in Postman with the above query and it does return the result for the scope/roleDefinitionId combination.