3
votes

I am trying to retrieve the Azure AD B2C users sign-in audit logs, but its throw below error

    var signIns = await _graphClient.AuditLogs.SignIns
        .Request()
        .GetAsync(); 

fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1] An unhandled exception has occurred while executing the request. Status Code: Forbidden Microsoft.Graph.ServiceException: Code: Authentication_RequestFromNonPremiumTenantOrB2CTenant Message: Neither tenant is B2C or tenant doesn't have premium license


Inner error: AdditionalData: date: 2020-10-05T10:12:34 request-id: 1740dcc7-3ffd-4d81-a721-a18e3fee0e1a client-request-id: 1740dcc7-3ffd-4d81-a721-a18e3fee0e1a ClientRequestId: 1740dcc7-3ffd-4d81-a721-a18e3fee0e1a

at Microsoft.Graph.HttpProvider.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at Microsoft.Graph.BaseRequest.SendRequestAsync(Object serializableObject, CancellationToken cancellationToken, HttpCompletionOption completionOption) at Microsoft.Graph.BaseRequest.SendAsync[T](Object serializableObject, CancellationToken cancellationToken, HttpCompletionOption completionOption) at Microsoft.Graph.AuditLogRootSignInsCollectionRequest.GetAsync(CancellationToken cancellationToken).

Thanks in advance

1
Based on the error message it states that your tenant is not licensed with an Azure AD P1 license. Can you make sure your tenant is having Azure AD P1 License - Raghavendra beldona

1 Answers

3
votes

This is accessing sign-in reports requires an Azure Active Directory premium 1 (P1) license.

Check it in Azure Portal Licenses.

enter image description here