在Microsoft Azure中,如何在api策略中检索operationid(applicationInsights)

问题描述 投票:0回答:1

在Azure API入站策略中,如何检索应用程序洞察operationId字段。

在入站xml中尝试以下但是它不起作用。也被context.Variables["InvocationId"]尝试过。

@{
 return (context.Operation.Id);

}
azure-application-insights azure-api-management
1个回答
0
投票

Azure APIM通过“context”变量提供对上下文的访问。记录在这里:https://docs.microsoft.com/en-us/azure/api-management/api-management-policy-expressions#ContextVariables。通常,它允许您访问完整的HTTP请求/响应,以及APIM维护自身的任何范围信息,如API,操作,产品e.t.c.您应该能够将operationId的值用作context.RequestId。

© www.soinside.com 2019 - 2024. All rights reserved.