具有Service Bus的v2 Azure Function触发器未触发 [英] v2 Azure Function with Service Bus trigger not firing

查看:35
本文介绍了具有Service Bus的v2 Azure Function触发器未触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有C#Functions SDK 1.0.23的Service Bus触发器的Azure Functions V2.我正在使用以下方法从KeyVault中获取机密并在触发器的设置中使用它们:

  • 问题#681
  • 有3种建议的解决方法,已在上文第210期中提到

    为了在这些部署选项为使用过的,请打开Azure门户,然后单击刷新"按钮,或创建一个对同步触发器端点的API调用: https://github.com/davidebbo/AzureWebsitesSamples/blob/master/ARMTemplates/FunctionsWebDeploy.json#L90

    Powershell示例: https://github.com/davidebbo/AzureWebsitesSamples/blob/master/PowerShell/HelperFunctions.ps1#L360-L365

    I am using Azure Functions V2 with a Service Bus trigger using 1.0.23 of the C# Functions SDK. I'm using the following approach to get secrets from KeyVault and use them within the settings of the triggers: How to map Azure Functions secrets from Key Vault automatically

    The function, especially when it has done nothing for a while, doesn't fire when there are messages on the subscription. If I then go to the portal and execute manually (yes, that particular execution is fired with a null message) it kicks it into life and picks up the other messages on the queue and processes them correctly.

    This obviously isn't ideally for our automated tests. Has anybody seen this, or know of anything that will help?

    Also, the Function App is running on a consumption plan.

    解决方案

    App Service Plan

    If you're using App Service plan then it's simple, just make use of Always on

    Consumption Plan

    If you're using Consumption plan, the issue could be that your triggers did not sync properly with the Azure Infrastructure (Central Listener). It could have happened due to the way you deployed/edited your trigger related settings as explained in issue #210 below.

    When you access the function directly from Portal, it might be forcing your function app to come alive, but as you can see that's only a workaround. Something similar is mentioned here

    Take a look at these issues:

    1. Service Bus Topic Trigger goes to sleep - Consumption Plan

      They also mention that it wakes up only on accessing it via the portal or calling a HTTP triggered function in the same app, which is similar to the behavior you are seeing.

    2. Issue #210

    3. Issue #681

    There are 3 suggested ways to resolve it, mentioned as part of Issue #210 above

    In order to synchronize triggers when these deployment options are used, open the Azure Portal and click the Refresh button, or make a API call to the sync triggers endpoint: https://github.com/davidebbo/AzureWebsitesSamples/blob/master/ARMTemplates/FunctionsWebDeploy.json#L90

    Powershell sample: https://github.com/davidebbo/AzureWebsitesSamples/blob/master/PowerShell/HelperFunctions.ps1#L360-L365

    这篇关于具有Service Bus的v2 Azure Function触发器未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆