Azure-functions-core-tools: `func host start` allows running in invalid directory

Created on 9 Aug 2019  路  4Comments  路  Source: Azure/azure-functions-core-tools

If you run func host start in a directory outside of the project, it exits with the error: Unable to find project root.. This is good behavior.

However, if you run func host start in a function subdirectory (e.g. HttpTrigger from the examples), then it will create a new host.json file and start. This is inconsistent behavior. A preferred behavior would be to exit similar to if it was outside of the directory.

Most helpful comment

personally I'd appreciate a way to run func host start --content <path to my function's root dir> so I don't have to cd to the dir before running func

All 4 comments

May i also suggest amending the original error message to:

Unable to find project root.
Expecting to find one of host.json, local.settings.json in project root.
Make sure you're running from your function app's root directory.

Added last line.

personally I'd appreciate a way to run func host start --content <path to my function's root dir> so I don't have to cd to the dir before running func

I agree with @brandonh-msft . Not having this feature makes it difficult to work with functions projects in VS Code when working in a large repo. For example, we have /dotnet/src/FunctionsApp, but VS Code needs to be open at /. This means we can't utilise tasks.json to run the functions app and speed up development

Having a feature like @brandonh-msft mentioned would be much appreciated. Any update on if/when we could expect something like that?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brandonh-msft picture brandonh-msft  路  4Comments

solvingj picture solvingj  路  5Comments

Kaushik27 picture Kaushik27  路  5Comments

Mikey032 picture Mikey032  路  3Comments

jackmusick picture jackmusick  路  4Comments