Skip to content

Add Filter for NewListForScopePager on RoleManagementPolicyAssignmentsClient #20780

Open
@StickNitro

Description

@StickNitro

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AuthorizationMgmtThis issue is related to a management-plane library.Service AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions