Thanks to the Azure Functions Core Tools you can develop and test your functions on your local computer.
However when I tried to run my function locally (through func start
), it failed with the following error message:
Can't determine project language from files. Please use one of [--csharp, --javascript, --typescript, --java, --python, --powershell, --custom]
The problem was caused because I didn’t had a local.settings.json file available locally.This file is required to let the local runtime detect the project language used for my function.To fix it you can either run func init
or create a local.settings.json file manually and add it to the project directory:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"IsEncrypted": false, | |
"Values": { | |
"AzureWebJobsStorage": "UseDevelopmentStorage=true", | |
"FUNCTIONS_WORKER_RUNTIME": "dotnet" | |
} | |
} |
Make sure that you have set the FUNCTIONS_WORKER_RUNTIME
setting to the correct language.