How do I ensure the generated query for detecting Azure B2C signin failures works?

151 Views Asked by At

When selecting my B2C tenant, the Azure Portal shows the following message:

"Looking for Log Analytics? In Log Analytics you can search for performance, diagnostics, health logs, and more. Visit Log Analytics"

So I click " Visit Log Analytics"

enter image description here

and then "Failed Signin reasons" (Run). enter image description here

The shown query is generated and its table and known to exist

but still the table name can't be resolved.... How do I make this work?

1

There are 1 best solutions below

0
Sridevi On

The error usually occurs if you missed integrating Azure AD B2C with Azure Monitor before running KQL query.

Initially, I ran that query without configuring Diagnostic settings for my B2C tenant and got same error as below:

SigninLogs
| where ResultType != 0
| summarize Count=count() by ResultDescription, ResultType
| sort by Count desc nulls last

Response:

enter image description here

To resolve the error, make sure to set up monitoring for your B2C tenant before running KQL queries.

In my case, I followed this MS Document and configured monitoring by adding Diagnostic setting for my B2C tenant like this:

enter image description here

When I ran same KQL query after some time in configured Log Analytics workspace, I got the results successfully as below:

SigninLogs
| where ResultType != 0
| summarize Count=count() by ResultDescription, ResultType
| sort by Count desc nulls last

Response:

enter image description here

Reference:

Monitor Azure AD B2C with Azure Monitor - Azure AD B2C | Microsoft