Remove an appManagementPolicy policy object from an application or service principal object. When you remove the appManagementPolicy, the application or service principal adopts the tenant-wide tenantAppManagementPolicy setting.
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.ReadWrite.ApplicationConfiguration
Delegated (personal Microsoft account)
Not supported.
Application
Application.Read.All and Policy.ReadWrite.ApplicationConfiguration
To configure application authentication method policies, the calling user must be assigned at least the Application Administrator or Cloud Application Administratordirectory role.
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Applications["{application-id}"].AppManagementPolicies["{appManagementPolicy-id}"].Ref.DeleteAsync();
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc applications app-management-policies ref-by-id delete --application-id {application-id} --app-management-policy-id {appManagementPolicy-id}
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
graphClient.applications().byApplicationId("{application-id}").appManagementPolicies().byAppManagementPolicyId("{appManagementPolicy-id}").ref().delete();
<?php
use Microsoft\Graph\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$graphServiceClient->applications()->byApplicationId('application-id')->appManagementPolicies()->byAppManagementPolicyId('appManagementPolicy-id')->ref()->delete()->wait();
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback.