简体   繁体   English

Azure Function 服务总线触发器在部署后不起作用

[英]Azure Function Service Bus Trigger Doesn't Work After the Deployment

I created a service bus and 2 azure functions.我创建了一个服务总线和 2 个 azure 函数。 One azure function is a timer trigger.一个 azure function 是一个定时器触发器。 It triggers every minute and pushes data into the service bus.它每分钟触发一次并将数据推送到服务总线。 Then the other azure function triggers and starts processing that data.然后另一个 azure function 触发并开始处理该数据。 This setup works well on my local machine.此设置在我的本地机器上运行良好。 But when I deployed these functions, only the time trigger keep pushing data.但是当我部署这些功能时,只有时间触发器不断推送数据。 My service bus trigger function doesn't trigger.我的服务总线触发器 function 没有触发。

这是定时器触发功能

这是服务总线触发器功能

After the deployement, I run service bus trigger function on my local machine again.部署后,我再次在本地机器上运行服务总线触发器 function。 Then I recive all enqued data.然后我收到所有入队的数据。

For all 3 services, I used basic plan and recomenned settings.对于所有 3 项服务,我使用了基本计划和推荐设置。

Is there a specific configuration to capture enqued data from deployed azure function?是否有特定配置可以从部署的 azure function 中捕获入队数据?

Two things to verify:要验证的两件事:

  1. Double check if the connectionstring for "ConnectStringForEmailDispacher" is added in configuration.仔细检查是否在配置中添加了“ConnectStringForEmailDispacher”的连接字符串。 Go to Azure portal->function-> left pane ->configuration or depends on how you are reading in DI ( appsettings) Go 到 Azure 门户->功能->左窗格->配置或取决于您在 DI 中的阅读方式(appsettings)

  2. Can you check the service bus in azure portal if the message count is increasing?如果消息数量在增加,您能否检查 azure 门户中的服务总线?

I have reproduced in my environment, and I got expected result.我已经在我的环境中进行了复制,并且得到了预期的结果。 I have taken two triggers (Service Bus Queue Trigger and Timer Trigger) Then when i run locally i get the output as expected like below:我采用了两个触发器(服务总线队列触发器和定时器触发器)然后当我在本地运行时,我得到 output,如下所示:在此处输入图像描述

Then i added my connection: In configuration section then click on apllication settings, then click on new application settings as below:然后我添加了我的连接:在配置部分,然后单击应用程序设置,然后单击新的应用程序设置,如下所示:

在此处输入图像描述

在此处输入图像描述 And then save it.然后保存它。 After that when I run my Timer Trigger it runs and when I send a message into queue it runs too.之后,当我运行 Timer Trigger 时,它运行,当我将消息发送到队列中时,它也运行。 Then when I check my logs, I am able to see my two triggers are running as below:然后当我检查我的日志时,我可以看到我的两个触发器正在运行,如下所示:在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM