List application and service principal objects that are assigned an appManagementPolicy policy object.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type
Permissions (from least to most privileged)
Delegated (work or school account)
Application.Read.All and Policy.Read.All, Application.Read.All and Policy.ReadWrite.ApplicationConfiguration
Delegated (personal Microsoft account)
Not supported.
Application
Application.Read.All and Policy.Read.All, Application.Read.All and Policy.ReadWrite.ApplicationConfiguration
HTTP request
GET /policies/appManagementPolicies/{id}/appliesTo
Optional query parameters
This method supports the $select, $filter, and $top OData query parameters to help customize the response. You can apply $filter on properties of application or servicePrincipal objects that support $filter. For example, the following query retrieves the appId and displayName of applications or service principals that are assigned the policy.
GET https://graph.microsoft.com/v1.0/policies/appManagementPolicies/{id}/appliesTo
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var result = await graphClient.Policies.AppManagementPolicies["{appManagementPolicy-id}"].AppliesTo.GetAsync();
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc policies app-management-policies applies-to list --app-management-policy-id {appManagementPolicy-id}
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->policies()->appManagementPolicies()->byAppManagementPolicyId('appManagementPolicy-id')->appliesTo()->get()->wait();
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
result = await graph_client.policies.app_management_policies.by_app_management_policie_id('appManagementPolicy-id').applie_to.get()
GET https://graph.microsoft.com/v1.0/policies/appManagementPolicies/{id}/appliesTo?$select=id,appId,displayName,createdDateTime
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var result = await graphClient.Policies.AppManagementPolicies["{appManagementPolicy-id}"].AppliesTo.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Select = new string []{ "id","appId","displayName","createdDateTime" };
});
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc policies app-management-policies applies-to list --app-management-policy-id {appManagementPolicy-id} --select "id,appId,displayName,createdDateTime"
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new AppliesToRequestBuilderGetRequestConfiguration();
$queryParameters = AppliesToRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->select = ["id","appId","displayName","createdDateTime"];
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->policies()->appManagementPolicies()->byAppManagementPolicyId('appManagementPolicy-id')->appliesTo()->get($requestConfiguration)->wait();
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
query_params = AppliesToRequestBuilder.AppliesToRequestBuilderGetQueryParameters(
select = ["id","appId","displayName","createdDateTime"],
)
request_configuration = AppliesToRequestBuilder.AppliesToRequestBuilderGetRequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.policies.app_management_policies.by_app_management_policie_id('appManagementPolicy-id').applie_to.get(request_configuration = request_configuration)
The following is an example of the response that returns id, appId, displayName and createdDateTime of applications and service principals where the policy is applied.