Skip to content

Latest commit

 

History

History
128 lines (89 loc) · 4.79 KB

File metadata and controls

128 lines (89 loc) · 4.79 KB
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

Assign homeRealmDiscoveryPolicy

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Assign a homeRealmDiscoveryPolicy to a servicePrincipal.

[!INCLUDE national-cloud-support]

Permissions

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]

HTTP request

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

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json

Request body

In the request body, supply the identifier of the homeRealmDiscoveryPolicy object (using an @odata.id property) that should be assigned to the service principal.

Response

If successful, this method returns 204 No Content response code. It doesn't return anything in the response body.

Examples

Request

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]


Response

The following example shows the response.

HTTP/1.1 204 No Content