[Azure CLI] "az rest" can get roleManagementPolicy but failed to patch it

Xinfeng Li 0 Reputation points

I'm trying to update role management policy with REST api, invoke the API with both Powershell cmelt "Invoke-RestMethod" and "Invoke-AzRestmethod" works fine:

$body = '{"properties": {"rules": [{"id": "Expiration_Admin_Eligibility","isExpirationRequired": true,"maximumDuration": "P60D","ruleType": "RoleManagementPolicyExpirationRule","target": {"caller": "Admin","enforcedSettings": [],"inheritableSettings": [],"level": "Eligibility","operations": ["All"],"targetObjects": []}}]}}'

$url = 'https://management.azure.com/subscriptions/
Azure Role-based access control
Azure Role-based access control
An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.
702 questions
{count} votes