【问题标题】:Azure Function EventGrid Trigger does not support Key Vault references?Azure 函数 EventGrid 触发器不支持 Key Vault 引用?
【发布时间】:2021-01-20 20:01:43
【问题描述】:

最初这个函数是由BlobStorage 上传触发的。我将函数更改为现在由EventGridEvents 触发。

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

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

想法?

【问题讨论】:

    标签: python azure-functions azureportal azure-eventgrid


    【解决方案1】:

    我是这样解决这个问题的:

    • 进入传送门并点击Code+TestTest/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 (?)。

    【讨论】:

    • 我有同样的问题,是的,看起来像 local.settings.json 中的 keyvault 引用,如下所示:“AzureWebJobsStorage”:“@Microsoft.KeyVault(SecretUri=https://..... )" 不受支持。
    猜你喜欢
    • 2018-10-26
    • 2021-09-27
    • 2018-05-06
    • 1970-01-01
    • 2021-02-02
    • 2020-10-12
    • 2016-05-01
    • 2020-09-18
    • 2020-05-04
    相关资源
    最近更新 更多