https://github.com/Azure/azure-webjobs-sdk-script/wiki/Retrieving-information-about-the-currently-running-function describes a EXECUTION_CONTEXT_FUNCTIONDIRECTORY environment variable. But it's not available for F# functions. Also Microsoft.Azure.WebJobs.ExecutionContext doesn't provide a FunctionDirectory property.
Add a comment
|
1 Answer
This sample function confirms that the property does exist:
let Run(req: HttpRequestMessage, log: TraceWriter, context: ExecutionContext) =
log.Info context.FunctionDirectory
req.CreateResponse(HttpStatusCode.OK, "Hello")
(tested in the portal on v1 runtime)
6 Comments
forki23
did not compile for me.
Mikhail Shilkov
What's your version of
Microsoft.Azure.WebJobs.Extensions?forki23
Microsoft.Azure.WebJobs.Extensions (2.0)
Mikhail Shilkov
How come?
Microsoft.NET.Sdk.Functions is referencing 2.1.x. Try upgrading.Mikhail Shilkov
My naive approach is to reference
Microsoft.NET.Sdk.Functions 1.0.7 which is not prerelease, and take whatever transient dependencies it has. |