governanceResource: register
Namespace: microsoft.graph
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Caution
This version of the Privileged Identity Management (PIM) API for Azure resources will be deprecated soon. Please use the new Azure REST PIM API for Azure resource roles.
Register a governanceResource object in Privileged Identity Management.
This API is available in the following national cloud deployments.
Global service | US Government L4 | US Government L5 (DOD) | China operated by 21Vianet |
---|---|---|---|
✅ | ✅ | ✅ | ❌ |
Permissions
The following table shows the least privileged permission or permissions required to call this API on each supported resource type. Follow best practices to request least privileged permissions. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Supported resource | Delegated (work or school account) | Delegated (personal Microsoft account) | Application |
---|---|---|---|
Microsoft Entra ID | PrivilegedAccess.ReadWrite.AzureAD | Not supported. | Not supported. |
Azure resources | PrivilegedAccess.ReadWrite.AzureResources | Not supported. | Not supported. |
group | PrivilegedAccess.ReadWrite.AzureADGroup | Not supported. | Not supported. |
The requester must also have at least one active role assignment on the resource.
HTTP request
POST /privilegedAccess/azureResources/resources/register
Optional query parameters
This method only supports the $select
and $expand
OData query parameters to help customize the response.
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Content-type | application/json |
Request body
Properties | Type | Description |
---|---|---|
externalId | String | The external identifier of the resource to be registered in PIM. If registering a subscription, the identifier is the subscription identifier prepended by /subscriptions/ . For example, /subscriptions/c14ae696-5e0c-4e5d-88cc-bef6637737ac . |
Response
If successful, this method returns a 200 OK
response.
Example
The following example shows how to call this API.
Request
POST https://graph.microsoft.com/beta/privilegedAccess/azureResources/resources/register
Content-type: application/json
{
"externalId": "/subscriptions/c14ae696-5e0c-4e5d-88cc-bef6637737ac"
}
Response
HTTP/1.1 200 OK