Steps to create an Azure Service bus namespace and a queue in Azure portal

13 Sep 2024
Create-an-azure-service-bus-in-azure-portal

Introduction

In this blog I will show you how to create an Azure Service Bus.

Step 1: Login to Azure Portal

1.1 Create a resource group

After logging in create a "Resource Group". It's a logical name where you can group all your resource. I would name my resource group "ServiceBusLearningRG"

1.2 Create a Azure Service Bus namespace

Look for "Azure Service Bus". When you click on "Create" you will be asked to create namespace. "ServiceBusLearning01". Namespace name has to be unique. "Pricing Tier" -I selected basic for this demo. Then i review and created the resource
CreateServiceBusNamespace

Step 2: Create a Queue

Once Service bus resource is created, navigate to the resource, in this case "ServiceBusLearning01" and click on create a Queue. I will give the queue name as "orderqueue" and leave the rest as default for the purpose of this demo. You can play around with it to see what suits you

Step 3: Get your Connection String to Azure Service Bus

In order to get the Connection Sting, navigate to the Azure Service Bus resource, i.e ServiceBusLearning01 > Settings --> Shared Access Policies --> RootManageSharedAccessKey. Once you click "RootManageSharedAccessKey" you will see the "Primary Connection String" and "Secondary Connection String"

Step 4: Keep things handy

Keep a note of the queue name that you created earlier i.e "OrderQueue" and the "Primary Connection String"." You will require the connection string since it has the authorization information required for your application to access data in an Azure Storage account at runtime using Shared Key authorization"

Step 5: How to Check Messages on the Queue

Once the service bus receives the messages, you can check them on the queue by following these steps in the Azure portal. Simply navigate to your Service Bus resource, select the desired queue, and use the Service Bus Explorer to peek at the messages from the start. This will allow you to view the messages without dequeuing them.

MessagesOnServiceBusQueue

Conclusion

I show you how to create Azure Service Bus on the Azure portal. We also learnt how to view the messages on the queue. You can also learn how to simulate an order processing System by integration Console Application,Azure Service Bus,Azure function and a web api.
The link to my blog
Official Microsoft Link