【发布时间】:2021-01-20 20:01:43
【问题描述】:
最初这个函数是由BlobStorage 上传触发的。我将函数更改为现在由EventGridEvents 触发。
我现在正在尝试注册一个事件,但触发器仍将 Azure Blob Storage (myblob) 显示为触发器。
我已将应用发布了 2 次并刷新了几次,但无济于事。
想法?
【问题讨论】:
标签: python azure-functions azureportal azure-eventgrid
最初这个函数是由BlobStorage 上传触发的。我将函数更改为现在由EventGridEvents 触发。
我现在正在尝试注册一个事件,但触发器仍将 Azure Blob Storage (myblob) 显示为触发器。
我已将应用发布了 2 次并刷新了几次,但无济于事。
想法?
【问题讨论】:
标签: python azure-functions azureportal azure-eventgrid
我是这样解决这个问题的:
Code+Test、Test/Run然后点击Run
AzureWebJobsStorage 值不正确。local.settings.json 中使用了 Key Vault reference,而不是直接使用连接字符串(以防止我的代码泄露机密)local.settings.json 中,从 Key Vault 引用更改为实际的连接字符串。触发器正确显示
恢复到 local.settings.json 中的 Key Vault 参考,并重新发布以测试错误是否返回。
果然:
2020-10-05T23:37:11.138 [Information] Initializing Warmup Extension./home/LogFiles/Application/Functions/Host/2020-10-05T21-04-07Z-59062a025e.log (https://function-dev.scm.azurewebsites.net/api/vfs/LogFiles/Application/Functions/Host/2020-10-05T21-04-07Z-59062a025e.log)
2020-10-05T21:04:07.832 [Information] Host started (642ms)
2020-10-05T21:04:07.833 [Information] Job host started
2020-10-05T21:04:07.835 [Error] The 'function-dev' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.function-dev'. Microsoft.Azure.WebJobs.Extensions.Storage: Storage account connection string for 'AzureWebJobsStorage' is invalid.
看起来像使用 Key Vault References,因为 EventGrid 触发器不支持 AppSettings (?)。
【讨论】: