Azure / azure-functions-dotnet-extensions

Azure Functions .NET extensions
MIT License
75 stars 42 forks source link

Get ExecutionContext.InvocationId in startup (Azure function V2) #30

Open ranciaro opened 5 years ago

ranciaro commented 5 years ago

Currently I can retrieve ExecutionContext inside the function method, like this: public async Task <IActionResult> Run ([HttpTrigger (AuthorizationLevel.Anonymous, "post", Route = null)], ILogger log, ExecutionContext context)

Is there any way I can retrieve ExecutionContext from my function startup?

fabiocav commented 5 years ago

@ranciaro we're working on a first class way do do that in the startup. Can you just confirm which property in the ExecutionContext you're interested in using in your Startup class? The initial design is primarily focused on exposing the application root directory to make loading dependencies a bit simpler.

ranciaro commented 5 years ago

@fabiocav The property that i need is just the InvocationId

jimmytricks commented 3 years ago

@fabiocav, do you know if this first class way was implemented yet? I haven't been able to find any information on it, cheers!

AdiThakker commented 1 year ago

Any update on this for ver. 3 /4? I want to retrieve ExecutionContext from DI and pass it to my class's constructor.