Get riskyServicePrincipal
Article
04/19/2023
2 contributors
Feedback
In this article
Namespace: microsoft.graph
Read the properties and relationships of a riskyServicePrincipal object.
Note: Using the riskyServicePrincipal API requires a Workload Identities 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.Read.All, IdentityRiskyServicePrincipal.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
IdentityRiskyServicePrincipal.Read.All, IdentityRiskyServicePrincipal.ReadWrite.All
HTTP request
GET /identityProtection/riskyServicePrincipals/{riskyServicePrincipalId}
Name
Description
Authorization
Bearer {token}. Required.
Request body
Do not supply a request body for this method.
Response
If successful, this method returns a 200 OK
response code and a riskyServicePrincipal object in the response body.
Examples
Request
GET https://graph.microsoft.com/v1.0/identityProtection/riskyServicePrincipals/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 result = await graphClient.IdentityProtection.RiskyServicePrincipals["{riskyServicePrincipal-id}"].GetAsync();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
result, err := graphClient.IdentityProtection().RiskyServicePrincipals().ByRiskyServicePrincipalId("riskyServicePrincipal-id").Get(context.Background(), nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
RiskyServicePrincipal riskyServicePrincipal = graphClient.identityProtection().riskyServicePrincipals("9089a539-a539-9089-39a5-899039a58990")
.buildRequest()
.get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
const options = {
authProvider,
};
const client = Client.init(options);
let riskyServicePrincipal = await client.api('/identityProtection/riskyServicePrincipals/9089a539-a539-9089-39a5-899039a58990')
.get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$result = $graphServiceClient->identityProtection()->riskyServicePrincipals()->byRiskyServicePrincipalId('riskyServicePrincipal-id')->get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": {
"@odata.type": "#microsoft.graph.riskyServicePrincipal",
"id": "9089a539-a539-9089-39a5-899039a58990",
"isEnabled": true,
"isProcessing": false,
"riskLastUpdatedDateTime": "2021-08-14T13:06:51.0451374Z",
"riskLevel": "high",
"riskState": "atRisk",
"riskDetail": "none",
"displayName": "Contoso App",
"appId": "b55552fe-a272-4b56-990b-95038d917878",
"servicePrincipalType": "Application"
}
}