I am trying to run locally my Azure Functions using python and the error message I get is the following:
[2023-03-03T11:34:59.832Z] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup
code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
I created my project with this command and did not change anything in the generated code:
func init LocalFunctionProj --python -m V2
When I try to run the app with this command then I get the error message mentioned above:
func start --verbose
I am running this on python v3.10. Also, when I tried to create the V1 python function it worked without any problems..
Any ideas why this is happening?
In my case, I was missing a line in local.settings.json
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing"
compared to the documentation here.
// local.settings.json
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "python",
"STORAGE_CONNECTION_STRING": "<AZURE_STORAGE_CONNECTION_STRING>",
"AzureWebJobsStorage": "<azure-storage-connection-string>",
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing"
}
}