Viewing Azure FrontDoor logs for error responses

KMW-2262 6 Reputation points
2021-12-23T09:07:14.243+00:00

When I query Frontdoor logs, I see only logs with http status 200 eventhough I had made requests resulting in http status 400 and message of the kind:
"Our services aren't available right now. We're working to restore all services as soon as possible. Please check back soon."
To able to view the failed requests, does my query below need modification?
160071-image.png

Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
593 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. GitaraniSharma-MSFT 47,931 Reputation points Microsoft Employee
    2021-12-23T12:18:11.463+00:00

    Hello @KMW-2262 ,

    Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

    When you open Azure Monitor Log Analytics, you have access to existing log queries.
    https://learn.microsoft.com/en-us/azure/azure-monitor/logs/queries#queries-dialog

    For Request errors by host and path, you can run the below existing log query:

    AzureDiagnostics
    | where ResourceProvider == "MICROSOFT.NETWORK" and Category == "FrontdoorAccessLog"
    | where isReceivedFromClient_b == true
    | where toint(httpStatusCode_s) >= 400
    | extend ParsedUrl = parseurl(requestUri_s)
    | summarize RequestCount = count() by Host = tostring(ParsedUrl.Host), Path = tostring(ParsedUrl.Path), StatusCode = httpStatusCode_s, ResourceId
    | order by RequestCount desc

    Screenshot of the example query from log analytics:

    160039-image.png

    NOTE : Raw logs include logs generated from both CDN edge (child POP) and origin shield. To differentiate the egress or responses from the edge nodes vs. origin shield, you can use the field isReceivedFromClient to get the correct data.
    Refer : https://learn.microsoft.com/en-us/azure/frontdoor/front-door-diagnostics#sent-to-origin-shield-deprecation

    Kindly let us know if the above helps or you need further assistance on this issue.

    ----------------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

  2. KMW-2262 6 Reputation points
    2021-12-24T10:58:09.117+00:00

    I have the same results (http 200 only) from both scopes ( frontdoor and log analytics workspace to which I send logs). Is any additional configuration required to see logs for http 4xx responses?

    Frontdoor logs for last 24h without any 'where' filter (http 4xx not seen):
    160228-image.png

    Diagnostic settings for frontdoor:
    160330-image.png

    Logs in log analytics workspace for last 24h without any 'where' filter (http 4xx not seen):
    160363-image.png