Azure Event Grid - Respond to Service Bus Events
The concept of Event Grid is simple; there are event sources pushing events, and there are subscribers interested in individual events, which handle them accordingly. Event Grid can manage multiple publishers and subscribers (event handlers) and sits as a mediator between them. Hence they are decoupled and have no dependencies with each other.
One of the event sources can be a Service Bus Namespace (Premium SKU only), consisting of queues. Subsequently, you can subscribe to active messages on a queue with no listeners. A Logic App can subscribe to these events and handle them through a workflow.
You create a Logic App and select the template for Azure Event Grid. Next, you configure the trigger by connecting to your subscription, select the resource type, resource name and the event type.
Once you have set the trigger action in the Logic App and save it, a subscription will be visible in the events blade of the service bus namespace.
When you send a message to a queue, an event will be raised and pushed to the Logic App (subscriber). Within the Logic App, you can follow up the trigger by getting messages from a queue using peek-lock. Next, you handle each message and complete the message.