在 azure 函数中处理消息后,是否需要从服务总线队列中删除消息?

Do I need to remove message from service bus queue after processing it in azure function?

Azure 的新手,我编写了一个 azure 函数,该函数在消息到达服务总线队列时触发。我需要手动删除此消息还是由服务总线处理?

不,您不必在使用服务总线触发器时手动删除消息:

The Functions runtime receives a message in PeekLock mode. It calls Complete on the message if the function finishes successfully, or calls Abandon if the function fails. If the function runs longer than the PeekLock timeout, the lock is automatically renewed as long as the function is running.

来源:Trigger - PeekLock behavior

Service Bus中的消息既可以peek lock模式接收,也可以receive and delete模式接收。 当在窥视锁定模式下收到消息时,消息不会从 queue.But 中删除当在接收和删除模式下收到消息时,消息会自动接收并从队列中删除。 因此删除消息取决于您执行的接收模式 Azure 函数以 peek-lock 模式接收消息,因此如果调用 complete(),消息将从队列中删除