Trying to fetch security alerts using graph API

Vijayakumar Raghu 5 Reputation points
2024-08-14T05:17:42.38+00:00

Hi,

I'm trying to fetch a list of security alerts using the Microsoft Graph API List Alerts.

I have granted the necessary API permissions with Admin consent, but I'm still encountering an error:

Unauthorized request - Account is not provisioned.

Screenshot 2024-08-14 at 10.39.53 AM

Interestingly, I can successfully fetch the Delegated Admin Relationship list using the same client and secret, but I'm only facing issues with Security Alerts. I'm using Postman to validate the API call, and below is the curl command I'm using to get the access token:

curl --location 'https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id={client-id}' \
--data-urlencode 'scope=https://graph.microsoft.com/.default' \
--data-urlencode 'client_secret={secret}' \
--data-urlencode 'grant_type=client_credentials'

Has anyone else faced this issue or have any suggestions on how to resolve it?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,988 questions
Microsoft Partner Center API
Microsoft Partner Center API
Microsoft Partner Center: A Microsoft website for partners that provides access to product support, a partner community, and other partner services.API: A software intermediary that allows two applications to interact with each other.
337 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 41,941 Reputation points
    2024-08-14T09:20:59.49+00:00

    Hi @Vijayakumar Raghu

    When I tried to call the /security/alerts_v2 endpoint, I encountered the same issue as you, but the old /security/alerts endpoint worked fine. I’m not sure if this is an unknown issue.

    Please try opening a support ticket to get help from the Microsoft support team.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.