How to digest Azure Service Bus request
This short tutorial is meant to assist you in digesting azure service bus requests
Once you have a queue or topic set up in Azure Service Bus, events will be delivered there as messages. A Service Bus message consists of two main parts: metadata and body.
Metadata: contains information about the message, such as "subject", "messageId", "eventKey", or "username". These values help identify the type of event, the origin, and when it was sent.
Body: points to the actual business data, stored in blob storage. This data describes what changed, such as updated product attributes.
When your application receives a message, it should evaluate both the metadata and the body to process the event appropriately. After processing, the message should be marked as completed. If it cannot be processed, it may be retried or moved to the dead-letter queue.
Example of a Service Bus message
The image below shows a typical message from the Azure Service Bus queue. The metadata includes values such as:

You can find a Service Bus message by navigating to your Azure Service Bus namespace in the Azure Portal, selecting the queue or topic subscription, and then opening the “Service Bus Explorer” to peek or receive messages.
Example of the blob payload
The Service Bus message references a blob containing the actual event data. In this example, the payload shows that a product was updated:
{
"ProductChanges": [
{
"Id": 2383136,
"UpdatedAttributes": ["Name"]
}
],
"TransactionUid": "a16163dd-7575-483e-9909-5706591fc03b"
}
This indicates that the product with the specific "Id" was updated, and the attribute that changed was "Name". The "TransactionUid" represents the identifier of the transaction in the changelog.
You can find the blob payload by going to the linked Azure Storage account, opening the container specified in the message metadata (for example by "blobName"), and locating the corresponding blob file that contains the event data.
Last updated