Skip to content

Commit d5085fa

Browse files
authored
Merge pull request #209026 from mumian/0824-bicep-service-bus
[Azure service bus] - new Bicep quickstart
2 parents 48542db + 0df705a commit d5085fa

File tree

3 files changed

+151
-20
lines changed

3 files changed

+151
-20
lines changed

articles/service-bus-messaging/TOC.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@
2121
href: service-bus-quickstart-powershell.md
2222
- name: Azure CLI
2323
href: service-bus-quickstart-cli.md
24+
- name: Bicep
25+
displayName: Resource Manager,ARM,template
26+
href: service-bus-resource-manager-namespace-queue-bicep.md
2427
- name: ARM template
25-
displayName: Resource Manager
28+
displayName: Resource Manager
2629
href: service-bus-resource-manager-namespace-queue.md
2730
- name: Send and receive messages
2831
items:
@@ -67,7 +70,7 @@
6770
- name: Handle Service Bus events via Event Grid
6871
items:
6972
- name: Azure Logic Apps
70-
href: service-bus-to-event-grid-integration-example.md
73+
href: service-bus-to-event-grid-integration-example.md
7174
- name: Azure Functions
7275
href: service-bus-to-event-grid-integration-function.md
7376
- name: Build message-driven business applications with NServiceBus
@@ -85,7 +88,7 @@
8588
- name: Compare Azure Queues and Service Bus queues
8689
href: service-bus-azure-and-service-bus-queues-compared-contrasted.md
8790
- name: Advanced features
88-
items:
91+
items:
8992
- name: Overview of advanced features
9093
href: advanced-features-overview.md
9194
- name: Message sessions
@@ -120,7 +123,7 @@
120123
href: service-bus-throttling.md
121124
- name: Enforce minimum required TLS version
122125
href: transport-layer-security-enforce-minimum-version.md
123-
- name: Federation
126+
- name: Federation
124127
items:
125128
- name: Message replication and cross-region federation
126129
href: service-bus-federation-overview.md
@@ -171,7 +174,7 @@
171174
- name: Publish and subscribe for messages using PHP
172175
href: service-bus-php-how-to-use-topics-subscriptions.md
173176
- name: Set subscription filters and actions
174-
href: service-bus-filter-examples.md
177+
href: service-bus-filter-examples.md
175178
- name: Message handling
176179
items:
177180
- name: Java message service (JMS) 2.0 entities
@@ -231,14 +234,14 @@
231234
- name: Enable partitions for a queue or topic
232235
href: enable-partitions.md
233236
- name: Enable auto forwarding for a queue or subscription
234-
href: enable-auto-forward.md
237+
href: enable-auto-forward.md
235238
- name: Enable dead lettering for a queue or subscription
236-
href: enable-dead-letter.md
239+
href: enable-dead-letter.md
237240
- name: Get message counters
238241
href: message-counters.md
239242
- name: Move across regions
240243
href: move-across-regions.md
241-
- name: Automatically update messaging units
244+
- name: Automatically update messaging units
242245
href: automate-update-messaging-units.md
243246
- name: Use Azure PowerShell to provision entities
244247
href: service-bus-manage-with-ps.md
@@ -298,12 +301,12 @@
298301
- name: Microsoft.ServiceBus.Messaging (.NET Framework)
299302
href: /dotnet/api/microsoft.servicebus.messaging
300303
- name: Java
301-
items:
304+
items:
302305
- name: Migrate from azure-servicebus to azure-messaging-servicebus
303306
href: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/servicebus/azure-messaging-servicebus/migration-guide.md
304307
- name: azure-messaging-servicebus (latest)
305308
href: /java/api/com.azure.messaging.servicebus
306-
- name: azure-servicebus
309+
- name: azure-servicebus
307310
href: /java/api/com.microsoft.azure.servicebus
308311
- name: Spring
309312
items:
@@ -314,19 +317,19 @@
314317
- name: Spring Cloud Stream Binder for Azure Service Bus
315318
href: /azure/developer/java/spring-framework/spring-cloud-azure?toc=/azure/service-bus-messaging/toc.json#spring-cloud-stream-binder-for-azure-service-bus
316319
- name: Python
317-
items:
320+
items:
318321
- name: azure-servicebus version 7
319322
href: /python/api/overview/azure/servicebus
320323
- name: Migrate from azure-servicebus version 0.50 to version 7
321324
href: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/servicebus/azure-servicebus/migration_guide.md
322325
- name: JavaScript
323326
items:
324-
- name: azure/service-bus version 7
327+
- name: azure/service-bus version 7
325328
href: /javascript/api/overview/azure/service-bus
326329
- name: Migrate from version 1 to version 7
327330
href: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/servicebus/service-bus/migrationguide.md
328331
- name: Go
329-
href: https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/messaging/azservicebus
332+
href: https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/messaging/azservicebus
330333
- name: PHP
331334
href: https://github.com/Azure/azure-sdk-for-php
332335
- name: Ruby
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-quickstart-bicep-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)