问题描述
最初,此功能是由BlobStorage
个上传触发的。我将功能更改为现在由EventGridEvents
触发。
我现在正在尝试注册一个事件,但是触发器仍然显示Azure Blob Storage (myblob)
作为触发器。
我已经将该应用发布了2次,并且刷新了几次,但无济于事。
想法?
解决方法
这是我的解决方法:
- 进入门户并单击
Code+Test
,Test/Run
,然后单击Run
- 这导致错误,表明
AzureWebJobsStorage
值不正确。 - 我在
local.settings.json
中使用了Key Vault 引用,而不是直接使用连接字符串(以防止密码泄露我的代码) - 在
local.settings.json
中,从“密钥库参考”更改为实际的连接字符串。 - 重新发布
- 刷新几次
- 然后...
触发器显示正确
-
在
local.settings.json
中恢复为密钥保管库参考,并重新发布以测试是否返回错误。 -
确定:
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 参考一样,因为EventGrid触发器(?)不支持AppSettings。