No Traces in Azure API Response

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



No Traces in Azure API Response



The Flag Ocp-Apim-Tracehas been set to true.


Ocp-Apim-Trace


true



The API Response displays this information under the Trace Tab:



Trace location was not specified in the response or trace log is not
available.



Yet no traces are available. How does one resolve this?




3 Answers
3



To enable trace, you need to include "Ocp-Apim-Trace" and "Ocp-Apim-Subscription-Key" in request header.



If the API does not require subscription, you can still get admin subscription key in developer portal. This enforce that only admin can get tracing log. To get admin subscription key if you are an admin, go to Developer Portal -> Profile -> find your target API and copy the key.



The Ocp-Apim-Trace feature enables you to specify whether or not APIM should generate a trace file on blob storage.



Setting the header to 'true' within Postman for example, will give you back a HTTP Header in the response called Ocp-Apim-Trace-Location.
This will contain the URL to your trace file, which you can open in any browser.



You might want to install a plugin/extension to be able to format JSON files properly in order to make it easy to read.





Install JSON plugin into where? Postman?
– ΩmegaMan
Aug 2 at 18:06





Just putting Ocp-Apim-Trace into postman does not,( maybe for me and how my APIM is setup), return any such http location. Is there setup required in Azure to return such a location?
– ΩmegaMan
Aug 2 at 18:11


Ocp-Apim-Trace





@ΩmegaMan you need to have an administrator subscription key to see the trace files being returned. Sorry for not mentioning this earlier.
– Pieter Vandenheede
Aug 6 at 9:30



Just setting the flag Ocp-Apim-Trace to true will not suffice.
One needs to set the subscription key as well as per this doc.



https://docs.microsoft.com/en-us/azure/api-management/api-management-advanced-policies#Trace



So, for API's which do not have a subscription key, not sure how one can get the traces





Mark this as the answer, which is ok to do, to close the issue.
– ΩmegaMan
Aug 2 at 18:07






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

1yDtDh6mcuhlYWAX,gIKs FY97ZB38kAQi7FlQm BD27zh,fwnSgQH cIZK,BTSG3xvg kyq9 B,SrnRr NEXnzEV4B7G set,GJI72b
D F5A1chy 15Os,IIDWBRpungaGtMtF,Ye7MDDOhs8zU8p auL8iL0c1MA

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3