fabiocav / azfunc-precompiled-sample

Pre-compiled function sample
13 stars 2 forks source link

Can't run sample #4

Open jaredcnance opened 7 years ago

jaredcnance commented 7 years ago

It doesn't appear that the sample can be run "as-is" without a host.json file.

C:\dev\azfunc-precompiled-sample\src\PreCompiledFunctionSample\bin\Debug (master)
λ func run function.json
Unable to find function project root. Expecting to have host.json in function project root.

Azure Functions Core Tools (1.0.0-beta.96) Function Runtime Version: 1.0.10955.0

Adding a host.json file results in the following output:

[5/15/2017 3:15:57 PM] Reading host configuration file 'C:\Users\jnance\dev\azfunc-precompiled-sample\src\PreCompiledFunctionSample\bin\Debug\host.json'
[5/15/2017 3:15:58 PM] Loaded custom extension: SendGridConfiguration from ''
[5/15/2017 3:15:59 PM] Generating 0 job function(s)
[5/15/2017 3:15:59 PM] Starting Host (HostId=bcapps01-1657870170, Version=1.0.10955.0, ProcessId=12852, Debug=False, Attempt=0)
[5/15/2017 3:15:59 PM] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. config.UseServiceBus(), config.UseTimers(), etc.).
[5/15/2017 3:15:59 PM] Job host started
...
jaredcnance commented 7 years ago

So, it turns out that there is some sort of undocumented (?) convention that the execution of func host start does not refer to the current directory, but instead the \bin folder. In order to get the sample to run I had to: