4
votes

I have an APIM policy using choose that is going down an unexpected logic path.

How Do I Access Active Directory Users/Groups In An Azure APIM Policy?

How do I debug this?

Is there a verbose mode that adds extra info to some logs?

Is it possible to dump the contents of the context or context.User or context.User.Groups to a log file that I can read?

How would I do that and where would the log file be?

1

1 Answers

4
votes

Currently you cannot really debug.

You may add <trace source="yourtraceidentifier">@(...your expression to trace goes here...)</trace> policy expressions which you would see

  1. in the developer portal trace
  2. on the URL emitted by the response HTTP header Ocp-Apim-Trace-Location: https://apimstoxnurcnsqhqwudvs35.blob.core.windows.net/apiinspectorcont... when you turn on the HTTP header Ocp-Apim-Trace: true
  3. in the future this trace information should also be emitted to Application Insights telemetry as trace elements

correction August 2021

With the Visual Studio extension for API Management it is possible to debug policies : https://docs.microsoft.com/en-us/azure/api-management/api-management-debug-policies