python - Azure功能没有实现部署时的触发器,但在本地工作

标签 python azure azure-functions

我的 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".

在本地,我看到所有触发器工作:

trigger

project structure

我使用 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/

相关文章:

python - 使用正则表达式搜索文件并返回函数名列表

azure 函数最大执行时间

node.js - 如何从 NodeJS 中的单个 azure 函数向 azure 服务总线和事件发送消息到事件中心总线?

c# - 如何从 CosmosDB 获取文档属性为小写但模型属性为大写的项目?

python - graphlab:如何将 gzip 压缩文件加载到 SFrame 中

python - 如何为所有子图设置一个颜色条

python - 定义 `__eq__` 的类型是不可散列的?

azure - 使用Blob存储服务REST API创建容器和azure存储服务中的StorageClient类库创建容器有什么区别?

dll - Windows Azure - 未找到 Microsoft.IdentityModel

asp.net-mvc - 当 Copy-Local 设置为 True 时,为什么 Azure 部署中缺少 DLL?