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

时间:2018-08-09 12:55:53

标签: azure-application-insights azure-api-management

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

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

@{
 return (context.Operation.Id);

}

1 个答案:

答案 0 :(得分:0)

Azure APIM通过“ context”变量提供对上下文的访问。在此处记录:https://docs.microsoft.com/en-us/azure/api-management/api-management-policy-expressions#ContextVariables。通常,它使您可以访问完整的HTTP请求/响应,以及APIM自己维护的任何范围信息,例如API,操作,产品等。您应该能够获得用于operationId的值作为context.RequestId。

相关问题