Azure role management policies are not directly configurable through the Azure portal. These policies are enforced by the Azure Role-Based Access Control (RBAC) system to ensure compliance and governance of role assignments.
To manage role management policies, you need to use the Azure REST API or Azure PowerShell cmdlets. The API endpoint you mentioned, role-management-policies/list-for-scope
, allows you to retrieve the role management policies defined for a specific scope.
Here's how you can manage role management policies using Azure PowerShell:
Install and configure Azure PowerShell: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps
- Use the
Get-AzRoleManagementPolicy
cmdlet to retrieve the role management policies for a specific scope. For example, to retrieve policies for the subscription scope:
Powershell -
Get-AzRoleManagementPolicy -Scope "/subscriptions/{subscriptionId}"
Replace {subscriptionId}
with the ID of your subscription.
You can use other Azure PowerShell cmdlets to create, update, or remove role assignments based on the defined policies.
Keep in mind that role management policies are designed to enforce specific rules, such as requiring expiration for role assignments. These policies help ensure compliance and good governance practices. If the policy specifies an expiration rule, you need to include an appropriate expiration duration in your role assignment requests.
Remember to exercise caution when modifying or removing role management policies, as they play a critical role in maintaining the security and compliance of your Azure environment.