Azure API 管理跟踪和调试

Azure API Management trace and debug

我在 Azure APIM 中有几个要测试的策略。我无法使用 Developer Console 调用这些 API,因此我通过 PostMan 调用这些 API。 当我在政策中遇到问题时(例如,验证 JWT 政策),我想知道如何完整跟踪幕后政策所做的调用(客户端->APIM、APIM 到后端等) ,但我不知道在哪里可以找到它? 谢谢

你可以debug APIs by using request tracing.

这是通过使用键 Ocp-Apim-Trace 和值 true 设置 header 来启用的。这是在从 Azure 门户发出请求时自动设置的。

You have to a subscription key with tracing enabled

有了这个 header,响应将包含一个 header ocp-apim-trace-location,其值设置为指向跟踪的 URL。