| title | Assign homeRealmDiscoveryPolicy |
|---|---|
| description | Assign a homeRealmDiscoveryPolicy to a service principal. |
| ms.localizationpriority | medium |
| author | aricrowe57 |
| ms.subservice | entra-applications |
| doc_type | apiPageType |
| ms.date | 07/26/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Assign a homeRealmDiscoveryPolicy to a servicePrincipal.
[!INCLUDE national-cloud-support]
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
You can address the service principal using either its id or appId. id and appId are referred to as the Object ID and Application (Client) ID, respectively, in app registrations in the Microsoft Entra admin center.
POST /servicePrincipals/{id}/homeRealmDiscoveryPolicies/$ref
POST /servicePrincipals(appId='{appId}')/homeRealmDiscoveryPolicies/$ref| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json |
In the request body, supply the identifier of the homeRealmDiscoveryPolicy object (using an @odata.id property) that should be assigned to the service principal.
If successful, this method returns 204 No Content response code. It doesn't return anything in the response body.
The following example shows a request.
POST https://graph.microsoft.com/beta/servicePrincipals/19c308f2-e088-464d-8ccb-7137b7bab660/homeRealmDiscoveryPolicies/$ref
Content-Type: application/json
{
"@odata.id": "https://graph.microsoft.com/beta/policies/homeRealmDiscoveryPolicies/6c6f154f-cb39-4ff9-bf5b-62d5ad585cde"
}[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
HTTP/1.1 204 No Content