我的 azure 功能在本地正常工作,但是当我将其部署在 azure 上时。它将返回此消息:
Deployment successful. deployer = ms-azuretools-vscode deploymentPath = Functions App ZipDeploy. Extract zip. Remote build.
Syncing triggers...
Querying triggers...
No HTTP triggers found.
Uploading settings...
Added the following settings:
- AzureWebJobsFeatureFlags
- FUNCTIONS_WORKER_PROCESS_COUNT
11:43:54 AM: Ignored the following settings that were already the same:
- FUNCTIONS_WORKER_RUNTIME
11:43:54 AM: WARNING: This operation will not delete any settings in "vietnam-trademark-scraper-dev-test". You must manually delete settings if desired.
11:43:54 AM: Excluded the following settings:
- AzureWebJobsStorage
11:43:54 AM: Error: Error "appSettings.properties with value "1" must be of type string." occurred in serializing the payload - "StringDictionary".
在本地,我看到所有触发器工作:
我使用 Python V2 模型 Azure Functions 触发器。我有一个专门的计划来部署它。
我尝试在谷歌上搜索这个问题,但不知道解决它。有人可以解释这个问题并建议我一些解决方案吗?谢谢
最佳答案
很高兴它通过添加设置 AzureWebJobsFeatureFlags:EnableWorkerIndexing
为您工作,并在 one 中展示了实用方法。我的解决方法。
I added this setting and redeployed and it works. But I don't know how it works? Can you explain it?
这是因为微软明确提到要添加用于在 Azure 中运行 Python 编程 v2 模型的应用程序设置。
无论我们添加的与AzureWebJobsFeatureFlags
相关的值是什么,都还没有准备好在生产中运行,但可以在完全发布之前进行实验,如本MS Doc中所定义的那样。 Azure Functions 应用程序设置。
此外,在 V2 编程模型中,Python 环境的多个工作进程 (FUNCTIONS_WORKER_PROCESS_COUNT
) 尚不支持大于 1,因此需要将此设置添加为功能标志才能工作。
引用GitHub Article有关详细信息,请参阅 Azure Functions Host of Worker Indexing Changes to Python Environment。
关于python - Azure功能没有实现部署时的触发器,但在本地工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74713086/