Skip to content

Commit 8355f4f

Browse files
committed
[Azure service bus] - new Bicep quickstart
1 parent 945f533 commit 8355f4f

File tree

2 files changed

+135
-7
lines changed

2 files changed

+135
-7
lines changed
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
title: Create Azure Service Bus namespace and queue using Bicep
3+
description: 'Quickstart: Create a Service Bus namespace and a queue using Bicep'
4+
documentationcenter: .net
5+
author: spelluru
6+
ms.author: spelluru
7+
ms.date: 08/24/2022
8+
ms.topic: quickstart
9+
ms.tgt_pltfrm: dotnet
10+
ms.custom: subject-bicepqs, mode-arm
11+
---
12+
13+
# Quickstart: Create a Service Bus namespace and a queue using a Bicep file
14+
15+
This article shows how to use a Bicep file that creates a Service Bus namespace and a queue within that namespace. The article explains how to specify which resources are deployed and how to define parameters that are specified when the deployment is executed. You can use this Bicep file for your own deployments, or customize it to meet your requirements.
16+
17+
[!INCLUDE [About Bicep](../../includes/resource-manager-bicep-quickstart-introduction.md)]
18+
19+
## Prerequisites
20+
21+
If you don't have an Azure subscription, [create a free account](https://azure.microsoft.com/free/) before you begin.
22+
23+
## Review the Bicep file
24+
25+
The Bicep file used in this quickstart is from [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/servicebus-create-queue/).
26+
27+
:::code language="bicep" source="~/quickstart-templates/quickstarts/microsoft.servicebus/servicebus-create-queue/main.bicep":::
28+
29+
The resources defined in the Bicep file include:
30+
31+
- [**Microsoft.ServiceBus/namespaces**](/azure/templates/microsoft.servicebus/namespaces?pivots=deployment-language-bicep)
32+
- [**Microsoft.ServiceBus/namespaces/queues**](/azure/templates/microsoft.servicebus/namespaces/queues?pivots=deployment-language-bicep)
33+
34+
> [!NOTE]
35+
> The following ARM templates are available for download and deployment.
36+
>
37+
> - [Create a Service Bus namespace with queue and authorization rule](service-bus-resource-manager-namespace-auth-rule.md)
38+
> - [Create a Service Bus namespace with topic and subscription](service-bus-resource-manager-namespace-topic.md)
39+
> - [Create a Service Bus namespace](service-bus-resource-manager-namespace.md)
40+
> - [Create a Service Bus namespace with topic, subscription, and rule](service-bus-resource-manager-namespace-topic-with-rule.md)
41+
42+
You can find more Bicep/ARM templates from [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/?resourceType=Microsoft.Servicebus&pageNumber=1&sort=Popular)
43+
44+
## Deploy the Bicep file
45+
46+
With this Bicep file, you deploy a Service Bus namespace with a queue.
47+
48+
[Service Bus queues](service-bus-queues-topics-subscriptions.md#queues) offer First In, First Out (FIFO) message delivery to one or more competing consumers.
49+
50+
1. Save the Bicep file as **main.bicep** to your local computer.
51+
1. Deploy the Bicep file using either Azure CLI or Azure PowerShell.
52+
53+
# [CLI](#tab/CLI)
54+
55+
```azurecli
56+
az group create --name exampleRG --location eastus
57+
az deployment group create --resource-group exampleRG --template-file main.bicep
58+
```
59+
60+
# [PowerShell](#tab/PowerShell)
61+
62+
```azurepowershell
63+
New-AzResourceGroup -Name exampleRG -Location eastus
64+
New-AzResourceGroupDeployment -ResourceGroupName exampleRG -TemplateFile ./main.bicep
65+
```
66+
67+
---
68+
69+
You will be prompted to enter the following parameter values:
70+
71+
- **serviceBusNamespaceName**: Name of the Service Bus namespace.
72+
- **serviceBusQueueName**: Name of the Queue.
73+
74+
When the deployment finishes, you should see a message indicating the deployment succeeded.
75+
76+
## Validate the deployment
77+
78+
Use the Azure portal, Azure CLI, or Azure PowerShell to list the deployed resources in the resource group.
79+
80+
# [CLI](#tab/CLI)
81+
82+
```azurecli-interactive
83+
az resource list --resource-group exampleRG
84+
```
85+
86+
# [PowerShell](#tab/PowerShell)
87+
88+
```azurepowershell-interactive
89+
Get-AzResource -ResourceGroupName exampleRG
90+
```
91+
92+
---
93+
94+
## Clean up resources
95+
96+
When no longer needed, use the Azure portal, Azure CLI, or Azure PowerShell to delete the VM and all of the resources in the resource group.
97+
98+
# [CLI](#tab/CLI)
99+
100+
```azurecli-interactive
101+
az group delete --name exampleRG
102+
```
103+
104+
# [PowerShell](#tab/PowerShell)
105+
106+
```azurepowershell-interactive
107+
Remove-AzResourceGroup -Name exampleRG
108+
```
109+
110+
---
111+
112+
## Next steps
113+
114+
See the following topic that shows how to create an authorization rule for the namespace/queue:
115+
116+
[Create a Service Bus authorization rule for namespace and queue using an ARM template](service-bus-resource-manager-namespace-auth-rule.md)
117+
118+
Learn how to manage these resources by viewing these articles:
119+
120+
* [Manage Service Bus with PowerShell](service-bus-manage-with-ps.md)
121+
* [Manage Service Bus resources with the Service Bus Explorer](https://github.com/paolosalvatori/ServiceBusExplorer/releases)
122+
123+
[Authoring Azure Resource Manager templates]: ../azure-resource-manager/templates/syntax.md
124+
[Service Bus namespace and queue template]: https://github.com/Azure/azure-quickstart-templates/blob/master/quickstarts/microsoft.servicebus/servicebus-create-queue/azuredeploy.json/
125+
[Azure Quickstart Templates]: https://azure.microsoft.com/resources/templates/?term=service+bus
126+
[Learn more about Service Bus queues]: service-bus-queues-topics-subscriptions.md
127+
[Using Azure PowerShell with Azure Resource Manager]: ../azure-resource-manager/management/manage-resources-powershell.md
128+
[Using the Azure CLI for Mac, Linux, and Windows with Azure Resource Management]: ../azure-resource-manager/management/manage-resources-cli.md

articles/service-bus-messaging/service-bus-resource-manager-namespace-queue.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ The template used in this quickstart is from [Azure Quickstart Templates](https:
3232

3333
The resources defined in the template include:
3434

35-
- [**Microsoft.ServiceBus/namespaces**](/azure/templates/microsoft.servicebus/namespaces)
36-
- [**Microsoft.ServiceBus/namespaces/queues**](/azure/templates/microsoft.servicebus/namespaces/queues)
35+
- [**Microsoft.ServiceBus/namespaces**](/azure/templates/microsoft.servicebus/namespaces?pivots=deployment-language-arm-template)
36+
- [**Microsoft.ServiceBus/namespaces/queues**](/azure/templates/microsoft.servicebus/namespaces/queues?pivots=deployment-language-arm-template)
3737

3838
> [!NOTE]
3939
> The following ARM templates are available for download and deployment.
@@ -57,19 +57,19 @@ To run the deployment automatically, click the following button: Create a new re
5757

5858
## Validate the deployment
5959

60-
1. Select **Notifications** at the top to see the status of the deployment. Wait until the deployment succeeds. Then, select **Go to resource group** in the notification message to navigate to the page for the resource group that contains the Service Bus namespace.
60+
1. Select **Notifications** at the top to see the status of the deployment. Wait until the deployment succeeds. Then, select **Go to resource group** in the notification message to navigate to the page for the resource group that contains the Service Bus namespace.
6161

6262
![Notification from deployment](./media/service-bus-resource-manager-namespace-queue/notification.png)
63-
2. Confirm that you see your Service Bus namespace in the list of resources.
63+
2. Confirm that you see your Service Bus namespace in the list of resources.
6464

6565
![Resource group - namespace](./media/service-bus-resource-manager-namespace-queue/resource-group-namespace.png)
66-
3. Select the namespace from the list to see the **Service Bus Namespace** page.
66+
3. Select the namespace from the list to see the **Service Bus Namespace** page.
6767

6868
## Clean up resources
6969

7070
1. In the Azure portal, navigate to the **Resource group** page for your resource group.
71-
2. Select **Delete resource group** from the toolbar.
72-
3. Type the name of the resource group, and select **Delete**.
71+
2. Select **Delete resource group** from the toolbar.
72+
3. Type the name of the resource group, and select **Delete**.
7373

7474
![Resource group - delete](./media/service-bus-resource-manager-namespace-queue/resource-group-delete.png)
7575

0 commit comments

Comments
 (0)