Reputation: 624
Every time i am debugging my Azure Functions (locally) then invoking a function, the CLI (func.exe) always shows requestId
as one of the incoming request's parameters which i am highly sure it is not from my side that generate it.
My question is, is it possible to extract the value of requestId
value from our code and how ? is this feature only specific for development/local debugging only ? since i can't find any documentation, article nor blog regarding this.
thank you
Upvotes: 2
Views: 1724
Reputation: 16802
I believe you will find the request information in the HttpContext
req.HttpContext.Items["MS_AzureFunctionsRequestID"]
c# code example assuming you have the following signature
public static async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req, ILogger log) {}
Upvotes: 2