Dismiss the risk of one or more riskyServicePrincipal objects. This action sets the targeted service principal account's risk level to none. You can dismiss up to 60 service principal accounts in one request.
Note: Using the riskyServicePrincipal API requires a Microsoft Entra Workload ID Premium license.
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.
Permission type
Least privileged permissions
Higher privileged permissions
Delegated (work or school account)
IdentityRiskyServicePrincipal.ReadWrite.All
Not available.
Delegated (personal Microsoft account)
Not supported.
Not supported.
Application
IdentityRiskyServicePrincipal.ReadWrite.All
Not available.
Important
In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. Security Administrator is the least privileged role supported for this operation.
HTTP request
POST /identityProtection/riskyServicePrincipals/dismiss
POST https://graph.microsoft.com/v1.0/identityProtection/riskyServicePrincipals/dismiss
Content-Type: application/json
{
"servicePrincipalIds": [
"9089a539-a539-9089-39a5-899039a58990"
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.IdentityProtection.RiskyServicePrincipals.Dismiss;
var requestBody = new DismissPostRequestBody
{
ServicePrincipalIds = new List<string>
{
"9089a539-a539-9089-39a5-899039a58990",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.IdentityProtection.RiskyServicePrincipals.Dismiss.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphidentityprotection "github.com/microsoftgraph/msgraph-sdk-go/identityprotection"
//other-imports
)
requestBody := graphidentityprotection.NewDismissPostRequestBody()
servicePrincipalIds := []string {
"9089a539-a539-9089-39a5-899039a58990",
}
requestBody.SetServicePrincipalIds(servicePrincipalIds)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.IdentityProtection().RiskyServicePrincipals().Dismiss().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.identityprotection.riskyserviceprincipals.dismiss.DismissPostRequestBody dismissPostRequestBody = new com.microsoft.graph.identityprotection.riskyserviceprincipals.dismiss.DismissPostRequestBody();
LinkedList<String> servicePrincipalIds = new LinkedList<String>();
servicePrincipalIds.add("9089a539-a539-9089-39a5-899039a58990");
dismissPostRequestBody.setServicePrincipalIds(servicePrincipalIds);
graphClient.identityProtection().riskyServicePrincipals().dismiss().post(dismissPostRequestBody);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\IdentityProtection\RiskyServicePrincipals\Dismiss\DismissPostRequestBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new DismissPostRequestBody();
$requestBody->setServicePrincipalIds(['9089a539-a539-9089-39a5-899039a58990', ]);
$graphServiceClient->identityProtection()->riskyServicePrincipals()->dismiss()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.identityprotection.riskyserviceprincipals.dismiss.dismiss_post_request_body import DismissPostRequestBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = DismissPostRequestBody(
service_principal_ids = [
"9089a539-a539-9089-39a5-899039a58990",
],
)
await graph_client.identity_protection.risky_service_principals.dismiss.post(request_body)