gpt4 book ai didi

azure - 如何查看来自 Azure REST API 请求的日志?

转载 作者:行者123 更新时间:2023-12-03 04:40:33 28 4
gpt4 key购买 nike

假设我向 Azure REST API 发送请求:

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

如果请求失败,我会收到一条错误消息:

{
"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"
}
}
}

如何查看 "request-id":"111111-2222-3333-4444-5555555""client-request-id":"引用的日志12345-1234-1234-1234-12345678"

最佳答案

  1. 没有内置资源来记录传入 Azure Rest API 的请求。

  2. 请参阅类似的 issues 之一关于 Azure 中使用的 REST API。

  3. 如果您的应用程序部署在 Azure 中,则应用程序洞察可用于跟踪目的。

  4. 创建了 Web 应用程序 > 创建并配置了应用程序洞察资源:

enter image description here

  • 转至 Web 应用程序的概述边栏选项卡 > 以图形表示方式发送到 Web 应用程序的请求:
  • enter image description here

  • 要查看 Web 应用程序的日志,请转到 Web 应用程序并单击“监控 session 中的日志”。
  • 示例:下面是一个可以在日志中看到的对网络应用程序的失败请求, enter image description here

    引用这个MS Doc有关 Azure Monitor App Insight 日志记录的详细信息。

    关于azure - 如何查看来自 Azure REST API 请求的日志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73984357/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com