Raj Rao
Raj Rao

Reputation: 9138

Azure Functions - Block processing of Azure Service Bus messages

I have an Azure Function (AF), that is triggered by Azure Service Bus messages. The messages are used to perform operations against another service. What I would like to do is that if there are transient failures in the service, then I would like to stop the message pump for a while. I do have Polly and a transient error policy to handle HTTP errors. But that allows me to retry after I have picked up a message. What I would like to do is to stop pulling messages for a while and then restart the pump. Is this possible with Azure Functions?

Upvotes: 1

Views: 566

Answers (2)

Bindu Chinnasamy
Bindu Chinnasamy

Reputation: 11

I recently was in this situation and built circuit breaker using App Insights ->Azure Monitor ->Azure Automation -> Disable Azure function. More details in the blog: https://medium.com/@binduc/circuit-breaker-pattern-for-azure-function-678ca0f7c3b5

Upvotes: 1

Sean Feldman
Sean Feldman

Reputation: 25994

You can't block Azure Function. Instead, you disable it. That means it will require manual intervention. Documentation on how to disable Azure Functions is available here.

Upvotes: 2

Related Questions