Creating a Service Bus namespace in the Azure portal

If you have not created a Service Bus namespace resource as part of an earlier exercise, then you can follow these steps to create a new instance of Service Bus through the Azure portal. To do this, you need an active Azure subscription. If you do not have one, then you can request the trial subscription at https://azure.microsoft.com/free/:

  1. Log in to the Azure portal at https://portal.azure.com.
  2. Click on the Create a resource blade on the left side of the Azure portal home page, and select Integration and then Service Bus.
  3. Enter a meaningful name for the Service Bus namespace, and select the Pricing tier and your Subscription. In Resource group, select any existing resource group or create a new resource group and click Create. This will create a new Service Bus namespace resource within the specified resource group:
  1. When using a Service Bus namespace as a messaging framework for your enterprise application, always follow the standard naming convention and use tags. This will help to locate the Service Bus resource in the Azure tenant. For the subscription owner, it can help them to derive billing patterns. With Azure DevOps, you can create an Azure Service Bus continuous integration and deployment pipeline by using either the ARM template or PowerShell. Here is the basic ARM definition for creating an Azure Service Bus namespace resource:
  "resources": [
{
"apiVersion": "2017-04-01",
"name": "[parameters('azureservicebusnamepaceName')]",
"location": "[resourceGroup().location]",
"type": "Microsoft.ServiceBus/namespaces",
"sku": {
"name": "Standard"
},
"properties": {},
"tags": {
"resourceType": "Azure Service Bus",
"envionment": "[parameters('azureservicebusenv')]"
},
"scale": null,
"dependsOn": []
}
]
  1. To create an ARM template from scratch, multiple open source solutions are available on GitHub. You can also use automation scripts from the Azure portal to work with a Service Bus ARM template. To look for an automation script, navigate to the appropriate resource group in the Resource group section and click on Automation Script. This will give you an example that you can use within your Integrated Development Environment (IDE), such as Visual Studio Code.
  2. Azure PowerShell also provides you with commands to manage your Service Bus namespace. To learn more about Service Bus management through Azure PowerShell, look at the Microsoft documentation: https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-manage-with-ps.
  1. We can also use the Azure CLI to manage an Azure Service Bus namespace resource. To create an Azure Service Bus namespace, open the Azure CLI and follow the instructions. Open your Azure CLI Bash window through the Azure portal and run the following command:
abhishek@Azure:~$ az servicebus namespace create --resource-group integrationpatterns05 --name dev-sb-integration --location westus2 --tags resourceType='Azure Service Bus' envionment='dev' --sku Standard 

Once the command has successfully executed, you can verify the result, which will describe the key parameters for the Service Bus namespace resource:

{
"createdAt": "2019-01-25T01:19:12.680000+00:00",
"id": "/subscriptions/**************/resourceGroups/integrationpatterns06/providers/Microsoft.ServiceBus/namespaces/dev-sb-integration",
"location": "West US 2",
"metricId": "****************:dev-sb-integration",
"name": "dev-sb-integration",
"provisioningState": "Succeeded",
"resourceGroup": "integrationpatterns06",
"serviceBusEndpoint": "https://dev-sb-integration.servicebus.windows.net:443/",
"sku": {
"capacity": null,
"name": "Standard",
"tier": "Standard"
},
"tags": {
"envionment": "dev",
"resourceType": "Azure Service Bus"
},
"type": "Microsoft.ServiceBus/Namespaces",
"updatedAt": "2019-01-25T01:19:35.313000+00:00"
}

In the preceding Bash script, integrationpatterns05 is the name of the resource group, dev-sb-integration is the name of the Service Bus namespace instance, while westus2 is the location of the Service Bus namespace resource. We have also added appropriate tags to identify resources based on tag values.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.221.19