1

Assume I send a request to the Azure REST API:

az rest 
  --method GET 
  --uri 'https://graph.microsoft.com/v1.0/applications/000000-00000-00000-00000' 
  | ConvertFrom-Json

If a request fail I get an error message:

{
    "error":
    {
        "code": "Request_BadRequest",
        "message": "One or more properties contains invalid values.",
        "innerError":
        {
            "date": "2022-10-07T06:12:04",
            "request-id": "111111-2222-3333-4444-5555555",
            "client-request-id": "12345-1234-1234-1234-12345678"
        }
    }
}

How can I view the log that is referenced with "request-id":"111111-2222-3333-4444-5555555" or "client-request-id":"12345-1234-1234-1234-12345678"?

Kristoffer Jälén
  • 4,112
  • 3
  • 30
  • 54
  • Please check if this helps [REST API Logs in Azure - Microsoft Q&A](https://learn.microsoft.com/en-us/answers/questions/101874/rest-api-logs-in-azure.html) – Sridevi Oct 17 '22 at 12:03

1 Answers1

-1
  1. There is no inbuilt resource to log the requests coming to Azure rest api.

  2. Refer to one of the similar issues regarding REST APIs using in Azure.

  3. Application insights can be used for tracking purpose if your application is deployed in azure.

  4. Created the Web App > created & configured application insights resource:

enter image description here

  1. Go to Overview blade of Web App > requests coming to web app in a graphical representation:

enter image description here

  1. To view logs of webapp, go to web app and click on Logs in Monitoring session.

Example: Below is one failed request to web app can be seen in logs, enter image description here

Refer to this MS Doc for more information on Azure Monitor App Insight Logging.

vijaya
  • 1,525
  • 1
  • 2
  • 6