Example of F# Azure Function using WebJobs attributes to auto-generate function.json
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.sdk.functions
FSharpHttpFull
.gitignore
FSharpHttpFull.sln
LICENSE
README.md

README.md

Example of F# Azure Function using WebJobs attributes to auto-generate function.json

This kind of Azure Function in F#

[<FunctionName("HttpTrigger")>]
let Run([<HttpTrigger>] req: HttpRequestMessage, log: TraceWriter) =
    log.Info("F# HTTP trigger function processed a request.")
    req.CreateResponse(HttpStatusCode.OK, "Hi there!")

is not supported by Microsoft.NET.Sdk.Functions directly (yet). To make auto-generation of function.json work, I'm calling the tool manually after each successful build.

See the following line in fsproj file:

<PostBuildEvent>"$(SolutionDir).sdk.functions\Microsoft.NET.Sdk.Functions.Generator.exe" "$(TargetPath)" "$(TargetDir)"</PostBuildEvent>