Azure Function EventGrid触发器不支持密钥保管库引用?

问题描述

最初,此功能是由BlobStorage个上传触发的。我将功能更改为现在由EventGridEvents触发。

我现在正在尝试注册一个事件,但是触发器仍然显示Azure Blob Storage (myblob)作为触发器。

我已经将该应用发布了2次,并且刷新了几次,但无济于事。

想法?

enter image description here

enter image description here

enter image description here

解决方法

这是我的解决方法:

  • 进入门户并单击Code+TestTest/Run,然后单击Run

enter image description here

  • 这导致错误,表明AzureWebJobsStorage值不正确。
  • 我在local.settings.json中使用了Key Vault 引用,而不是直接使用连接字符串(以防止密码泄露我的代码)
  • local.settings.json中,从“密钥库参考”更改为实际的连接字符串。
  • 重新发布
  • 刷新几次
  • 然后...

触发器显示正确

enter image description here

  • 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。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...