Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Use Microsoft Entra Privileged Identity Management (PIM) to allow eligible role members for Azure resources to schedule activation for a future date and time. They can also select a specific activation duration within the maximum (configured by administrators).
This article is for members who need to activate their Azure resource role in Privileged Identity Management.
Note
Agents and agent identities can receive and activate eligible Azure resource role assignments in preview. Each agent or agent identity requires an E7 license. See agent preview requirements. For activation, see Agent identity API activation (preview).
Choose the method you will use to activate your Azure role assignment.
Important
When a role is activated, Microsoft Entra PIM temporarily adds active assignment for the role. Microsoft Entra PIM creates active assignment (assigns user to a role) within seconds. When deactivation (manual or through activation time expiration) happens, Microsoft Entra PIM removes the active assignment within seconds as well.
Application may provide access based on the role the user has. In some situations, application access may not immediately reflect the fact that user got role assigned or removed. If application previously cached the fact that user does not have a role – when user tries to access application again, access may not be provided. Similarly, if application previously cached the fact that user has a role – when role is deactivated, user may still get access. Specific situation depends on the application’s architecture. For some applications, signing out and signing back in may help get access added or removed.
Activate a role in the Microsoft Entra admin center
When you need to take on an Azure resource role, you can request activation by using the My roles navigation option in Privileged Identity Management.
Sign in to the Microsoft Entra admin center.
Browse to Identity Governance > Privileged Identity Management > My roles.
Select Azure resources to see a list of your eligible Azure resource roles.

In the Azure resource roles list, find the role you want to activate.
Select Activate to open the Activate page.

If your role requires multifactor authentication, select Verify your identity before proceeding. You only have to authenticate once per session.
Select Verify my identity and follow the instructions to provide additional security verification.

It's a best practice to only request access to the resources you need. If you want to specify a reduced scope.
Go to the Scope tab.
Click Select scope to select the scope.
Use the dropdown provided to scope the search to a specific resource.
The reduced scoped resources are shown in Selected resources before activation and should be selected from the grid provided. The dropdown selection does not define the reduced scope.
Note
If your eligibility is at the management group level, the dropdown will show all direct child resources (management group and subscription). You can select either a management group or subscription from the grid shown, or further scope down the search by selecting the appropriate management group or subscription.

If necessary, specify a custom activation start time. The member would be activated after the selected time.
In the Reason box, enter the reason for the activation request.
Optional: If your administrator enabled Allow least-privilege role activation on the policy for your eligible role, select the Role tab. In the Role dropdown, choose an available lower-privileged role whose permissions are sufficient for your task.
The eligible role's policy governs approval, authentication, justification, and activation maximum duration, including selection of a lower-privileged role.
Optional: To request a Microsoft Security Copilot recommendation, select the Activate tab and review the task description in the Reason box. Select Copilot can recommend a lower-privileged role.
This option requires Allow least-privilege role activation to be enabled and access to Microsoft Security Copilot in your tenant. A default Security Copilot workspace must be available for the Microsoft Entra integration, and you must have access to it. Recommendations consume security compute units (SCUs). You can select a role manually without Copilot when Allow least-privilege role activation is enabled.
Review the recommended role and its suitability for your task. To use it, select Switch to the recommended role. Copilot doesn't create eligible role assignments or activate a role on your behalf. The eligible role's policy requirements still apply.
Select Activate.
Note
If the role requires approval to activate, a notification will appear in the upper right corner of your browser informing you the request is pending approval.
Activate a role in the Azure portal
Privileged Identity Management role activation is integrated into the Billing and Access Control (AD) extensions within the Azure portal. Shortcuts to Subscriptions (billing) and Access Control (AD) allow you to activate PIM roles directly from these blades.
From the Subscriptions blade, select “View eligible subscriptions” in the horizontal command menu to check your eligible, active, and expired assignments. From there, you can activate an eligible assignment in the same pane.


In Access control (IAM) for a resource, you can now select “View my access” to see your currently active and eligible role assignments and activate directly.

By integrating PIM capabilities into different Azure portal blades, this new feature allows you to gain temporary access to view or edit subscriptions and resources more easily.
View the status of your requests
You can view the status of your pending requests to activate.
Open Microsoft Entra Privileged Identity Management.
Select My requests to see a list of your Microsoft Entra role and Azure resource role requests.
Scroll to the right to view the Request Status column.
Cancel a pending request
If you don't require activation of a role that requires approval, you can cancel a pending request at any time.
Open Microsoft Entra Privileged Identity Management.
Select My requests.
For the role that you want to cancel, select the Cancel link.
When you select Cancel, the request will be canceled. To activate the role again, you will have to submit a new request for activation.

Activate a role with Azure Resource Manager API
Privileged Identity Management supports Azure Resource Manager API commands to manage Azure resource roles, as documented in the PIM ARM API reference. For the permissions required to use the PIM API, see Understand the Privileged Identity Management APIs.
To activate an eligible Azure role assignment and gain activated access, use the Role Assignment Schedule Requests - Create REST API to create a new request and specify the security principal, role definition, requestType = SelfActivate and scope. To call this API, you must have an eligible role assignment on the scope.
Use a GUID tool to generate a unique identifier for the role assignment identifier. The identifier has the format: 00000000-0000-0000-0000-000000000000.
Replace {roleAssignmentScheduleRequestName} in the PUT request with the GUID identifier of the role assignment.
For more information about eligible roles for Azure resources management, see PIM ARM API tutorial.
This is a sample HTTP request to activate an eligible assignment for an Azure role.
Request
PUT https://management.chinacloudapi.cn/providers/Microsoft.Subscription/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}?api-version=2020-10-01
Request body
{
"properties": {
"principalId": "aaaaaaaa-bbbb-cccc-1111-222222222222",
"roleDefinitionId": "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608",
"requestType": "SelfActivate",
"linkedRoleEligibilityScheduleId": "b1477448-2cc6-4ceb-93b4-54a202a89413",
"scheduleInfo": {
"startDateTime": "2020-09-09T21:35:27.91Z",
"expiration": {
"type": "AfterDuration",
"endDateTime": null,
"duration": "PT8H"
}
},
"condition": "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'",
"conditionVersion": "1.0"
}
}
Response
Status code: 201
{
"properties": {
"targetRoleAssignmentScheduleId": "c9e264ff-3133-4776-a81a-ebc7c33c8ec6",
"targetRoleAssignmentScheduleInstanceId": null,
"scope": "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
"roleDefinitionId": "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608",
"principalId": "aaaaaaaa-bbbb-cccc-1111-222222222222",
"principalType": "User",
"requestType": "SelfActivate",
"status": "Provisioned",
"approvalId": null,
"scheduleInfo": {
"startDateTime": "2020-09-09T21:35:27.91Z",
"expiration": {
"type": "AfterDuration",
"endDateTime": null,
"duration": "PT8H"
}
},
"ticketInfo": {
"ticketNumber": null,
"ticketSystem": null
},
"justification": null,
"requestorId": "a3bb8764-cb92-4276-9d2a-ca1e895e55ea",
"createdOn": "2020-09-09T21:35:27.91Z",
"condition": "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'",
"conditionVersion": "1.0",
"expandedProperties": {
"scope": {
"id": "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
"displayName": "Pay-As-You-Go",
"type": "subscription"
},
"roleDefinition": {
"id": "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608",
"displayName": "Contributor",
"type": "BuiltInRole"
},
"principal": {
"id": "a3bb8764-cb92-4276-9d2a-ca1e895e55ea",
"displayName": "User Account",
"email": "user@my-tenant.com",
"type": "User"
}
}
},
"name": "fea7a502-9a96-4806-a26f-eee560e52045",
"id": "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/providers/Microsoft.Authorization/RoleAssignmentScheduleRequests/fea7a502-9a96-4806-a26f-eee560e52045",
"type": "Microsoft.Authorization/RoleAssignmentScheduleRequests"
}
Activate an agent identity with Azure Resource Manager API (preview)
Use the Azure Resource Manager API to activate an eligible Azure resource role assignment for an agent identity. The agent identity requires an E7 license and an existing eligible assignment.
The following example assumes an access token is already available in $TOKEN.
Gather the following values for the eligible assignment:
- Assignment scope.
- Agent identity object ID.
- Role definition ID.
- Eligibility schedule ID.
Generate a unique GUID for
{new-guid}. Useuuidgenin Bash, or generate the GUID in PowerShell with[guid]::NewGuid().Replace the brace-delimited placeholders in the example with your assignment values. Run the curl command in Bash to submit a
PUTrequest toroleAssignmentScheduleRequestsat the assignment scope. Use camelCase for all property names, as shown in the example.The request uses
SelfActivate, links to the existing eligibility schedule, and requests a ten-minute activation withPT10M. The example duration isn't a product default or maximum.curl --request PUT \ --url "https://management.chinacloudapi.cn/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{new-guid}?api-version=2020-10-01" \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ --data '{ "properties": { "principalId": "{sp-object-id}", "roleDefinitionId": "{scope}/providers/Microsoft.Authorization/roleDefinitions/{role-definition-id}", "requestType": "SelfActivate", "linkedRoleEligibilityScheduleId": "{eligibility-schedule-guid}", "justification": "Testing PIM SP activation", "scheduleInfo": { "startDateTime": null, "expiration": { "duration": "PT10M", "type": "AfterDuration" } }, "ticketInfo": { "ticketNumber": "", "ticketSystem": "" } } }'Check the response. A
statusvalue ofProvisionedconfirms activation. Don't treat request submission alone as completed activation.
Deactivate a role assignment
When a role assignment is activated, you see a Deactivate option in the PIM portal for the role assignment. Also, you can't deactivate a role assignment within five minutes after activation.
To deactivate your active role assignment by using the Azure Resource Manager API, create a role assignment schedule request with properties.requestType set to SelfDeactivate. For the request format and authorization details, see Role Assignment Schedule Requests - Create.


