Reputation: 435
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
Upvotes: 2
Views: 2584
Reputation: 16498
This is accessing sign-in reports requires an Azure Active Directory premium 1 (P1) license.
Check it in Azure Portal Licenses.
Upvotes: 3