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 an Entra Workload Identity Premium license.
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)
IdentityRiskyServicePrincipal.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
IdentityRiskyServicePrincipal.ReadWrite.All
For delegated scenarios, the signed-in user must have one of the following Azure AD roles.
Security Administrator
Global Administrator
HTTP request
POST /identityProtection/riskyServicePrincipals/dismiss
Request headers
Name
Description
Authorization
Bearer {token}. Required.
Request body
In the request body, specify the collection of ids of the risky service principals in a servicePrincipalIds property.
Response
If successful, this action returns a 204 No Content response code. It does not return anything in the response body.
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
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.IdentityProtection.RiskyServicePrincipals.Dismiss.DismissPostRequestBody
{
ServicePrincipalIds = new List<string>
{
"9089a539-a539-9089-39a5-899039a58990",
},
};
await graphClient.IdentityProtection.RiskyServicePrincipals.Dismiss.PostAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc identity-protection risky-service-principals dismiss post --body '{\
"servicePrincipalIds": [\
"9089a539-a539-9089-39a5-899039a58990"\
]\
}\
'
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new DismissPostRequestBody();
$requestBody->setServicePrincipalIds(['9089a539-a539-9089-39a5-899039a58990', ]);
$graphServiceClient->identityProtection()->riskyServicePrincipals()->dismiss()->post($requestBody)->wait();
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = DismissPostRequestBody(
service_principal_ids = [
"9089a539-a539-9089-39a5-899039a58990",
]
)
await graph_client.identity_protection.risky_service_principals.dismiss.post(request_body = request_body)