0

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.

1 Answer 1

1

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)

Sign up to request clarification or add additional context in comments.

6 Comments

did not compile for me.
What's your version of Microsoft.Azure.WebJobs.Extensions?
Microsoft.Azure.WebJobs.Extensions (2.0)
How come? Microsoft.NET.Sdk.Functions is referencing 2.1.x. Try upgrading.
My naive approach is to reference Microsoft.NET.Sdk.Functions 1.0.7 which is not prerelease, and take whatever transient dependencies it has.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.