gyu*_*isc 0 python azure azure-functions
我尝试使用 python 在本地运行我的 Azure Functions,收到的错误消息如下:
[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.).
Run Code Online (Sandbox Code Playgroud)
我使用此命令创建了我的项目,并且没有更改生成的代码中的任何内容:
func init LocalFunctionProj --python -m V2
Run Code Online (Sandbox Code Playgroud)
当我尝试使用此命令运行应用程序时,我收到上述错误消息:
func start --verbose
Run Code Online (Sandbox Code Playgroud)
我在 python v3.10 上运行它。另外,当我尝试创建 V1 python 函数时,它工作没有任何问题。
有什么想法为什么会发生这种情况吗?
就我而言,我在 local.settings.json 中缺少一行
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing"
与此处的文档相比。
// local.settings.json
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "python",
"STORAGE_CONNECTION_STRING": "<AZURE_STORAGE_CONNECTION_STRING>",
"AzureWebJobsStorage": "<azure-storage-connection-string>",
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing"
}
}
Run Code Online (Sandbox Code Playgroud)