Proposed Pull Request Change

title description author ms.topic ms.tgt_pltfrm ms.date ms.author ms.custom ms.devlang
Create Service Bus topic subscription and rule using Azure template Create a Service Bus namespace with topic, subscription, and rule using Azure Resource Manager template spelluru article dotnet 09/27/2021 spelluru devx-track-azurecli, devx-track-arm-template azurecli
📄 Document Links
GitHub View on GitHub Microsoft Learn View on Microsoft Learn
Content Truncation Detected
The generated rewrite appears to be incomplete.
Original lines: -
Output lines: -
Ratio: -
Raw New Markdown
Generating updated version of doc...
Rendered New Markdown
Generating updated version of doc...
+0 -0
+0 -0
--- title: Create Service Bus topic subscription and rule using Azure template description: Create a Service Bus namespace with topic, subscription, and rule using Azure Resource Manager template author: spelluru ms.topic: article ms.tgt_pltfrm: dotnet ms.date: 09/27/2021 ms.author: spelluru ms.custom: devx-track-azurecli, devx-track-arm-template ms.devlang: azurecli --- # Create a Service Bus namespace with topic, subscription, and rule using an Azure Resource Manager template This article shows how to use an Azure Resource Manager template that creates a Service Bus namespace with a topic, subscription, and rule (filter). 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 template for your own deployments, or customize it to meet your requirements For more information about creating templates, see [Authoring Azure Resource Manager templates][Authoring Azure Resource Manager templates]. For more information about practice and patterns on Azure resources naming conventions, see [Recommended naming conventions for Azure resources][Recommended naming conventions for Azure resources]. For the complete template, see the [Service Bus namespace with topic, subscription, and rule][Service Bus namespace with topic, subscription, and rule] template. > [!NOTE] > The following Azure Resource Manager templates are available for download and deployment. > > * [Create a Service Bus namespace with queue and authorization rule](service-bus-resource-manager-namespace-auth-rule.md) > * [Create a Service Bus namespace with queue](service-bus-resource-manager-namespace-queue.md) > * [Create a Service Bus namespace](service-bus-resource-manager-namespace.md) > * [Create a Service Bus namespace with topic and subscription](service-bus-resource-manager-namespace-topic.md) > > To check for the latest templates, visit the [Azure Quickstart Templates][Azure Quickstart Templates] gallery and search for Service Bus. ## What do you deploy? With this template, you deploy a Service Bus namespace with topic, subscription, and rule (filter). [Service Bus topics and subscriptions](service-bus-queues-topics-subscriptions.md#topics-and-subscriptions) provide a one-to-many form of communication, in a *publish/subscribe* pattern. When using topics and subscriptions, components of a distributed application do not communicate directly with each other, instead they exchange messages via topic that acts as an intermediary.A subscription to a topic resembles a virtual queue that receives copies of messages that were sent to the topic. A filter on subscription enables you to specify which messages sent to a topic should appear within a specific topic subscription. ## What are rules (filters)? In many scenarios, messages that have specific characteristics must be processed in different ways. To enable this custom processing, you can configure subscriptions to find messages that have specific properties and then perform modifications to those properties. Although Service Bus subscriptions see all messages sent to the topic, you can only copy a subset of those messages to the virtual subscription queue. It is accomplished using subscription filters. To learn more about rules (filters), see [Rules and actions](service-bus-queues-topics-subscriptions.md#rules-and-actions). To run the deployment automatically, click the following button: [![Deploy to Azure](./media/service-bus-resource-manager-namespace-topic/deploybutton.png)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.servicebus%2Fservicebus-create-topic-subscription-rule%2Fazuredeploy.json) ## Parameters With Azure Resource Manager, define parameters for values you want to specify when the template is deployed. The template includes a section called `Parameters` that contains all the parameter values. Define a parameter for those values that vary based on the project you are deploying or based on the environment you are deploying to. Do not define parameters for values that always stay the same. Each parameter value is used in the template to define the resources that are deployed. The template defines the following parameters: ### serviceBusNamespaceName The name of the Service Bus namespace to create. ```json "serviceBusNamespaceName": { "type": "string" } ``` ### serviceBusTopicName The name of the topic created in the Service Bus namespace. ```json "serviceBusTopicName": { "type": "string" } ``` ### serviceBusSubscriptionName The name of the subscription created in the Service Bus namespace. ```json "serviceBusSubscriptionName": { "type": "string" } ``` ### serviceBusRuleName The name of the rule(filter) created in the Service Bus namespace. ```json "serviceBusRuleName": { "type": "string", } ``` ### serviceBusApiVersion The Service Bus API version of the template. ```json "serviceBusApiVersion": { "type": "string", "defaultValue": "2017-04-01", "metadata": { "description": "Service Bus ApiVersion used by the template" } ``` ## Resources to deploy Creates a standard Service Bus namespace of type **Messaging**, with topic and subscription and rules. ```json "resources": [{ "apiVersion": "[variables('sbVersion')]", "name": "[parameters('serviceBusNamespaceName')]", "type": "Microsoft.ServiceBus/Namespaces", "location": "[variables('location')]", "sku": { "name": "Standard", }, "resources": [{ "apiVersion": "[variables('sbVersion')]", "name": "[parameters('serviceBusTopicName')]", "type": "Topics", "dependsOn": [ "[concat('Microsoft.ServiceBus/namespaces/', parameters('serviceBusNamespaceName'))]" ], "properties": { "path": "[parameters('serviceBusTopicName')]" }, "resources": [{ "apiVersion": "[variables('sbVersion')]", "name": "[parameters('serviceBusSubscriptionName')]", "type": "Subscriptions", "dependsOn": [ "[parameters('serviceBusTopicName')]" ], "properties": {}, "resources": [{ "apiVersion": "[variables('sbVersion')]", "name": "[parameters('serviceBusRuleName')]", "type": "Rules", "dependsOn": [ "[parameters('serviceBusSubscriptionName')]" ], "properties": { "filterType": "SqlFilter", "sqlFilter": { "sqlExpression": "StoreName = 'Store1'", "requiresPreprocessing": "false" }, "action": { "sqlExpression": "set FilterTag = 'true'" } } }] }] }] }] ``` For JSON syntax and properties, see [namespaces](/azure/templates/microsoft.servicebus/namespaces), [topics](/azure/templates/microsoft.servicebus/namespaces/topics), [subscriptions](/azure/templates/microsoft.servicebus/namespaces/topics/subscriptions), and [rules](/azure/templates/microsoft.servicebus/namespaces/topics/subscriptions/rules). ## Commands to run deployment [!INCLUDE [app-service-deploy-commands](../../includes/app-service-deploy-commands.md)] ## PowerShell ```powershell-interactive New-AzureResourceGroupDeployment -Name \<deployment-name\> -ResourceGroupName \<resource-group-name\> -TemplateUri <https://raw.githubusercontent.com/azure/azure-quickstart-templates/master/quickstarts/microsoft.servicebus/servicebus-create-topic-subscription-rule/azuredeploy.json> ``` ## Azure CLI ```azurecli-interactive az deployment group create -g \<my-resource-group\> --template-uri <https://raw.githubusercontent.com/azure/azure-quickstart-templates/master/quickstarts/microsoft.servicebus/servicebus-create-topic-subscription-rule/azuredeploy.json> ``` ## Next steps Learn how to manage these resources by viewing these articles: * [Manage Azure Service Bus](service-bus-management-libraries.md) * [Manage Service Bus with PowerShell](service-bus-manage-with-ps.md) * [Manage Service Bus resources with the Service Bus Explorer](https://github.com/paolosalvatori/ServiceBusExplorer/releases) [Authoring Azure Resource Manager templates]: ../azure-resource-manager/templates/syntax.md [Azure Quickstart Templates]: https://azure.microsoft.com/resources/templates/?term=service+bus [Learn more about Service Bus topics and subscriptions]: service-bus-queues-topics-subscriptions.md [Using Azure PowerShell with Azure Resource Manager]: ../azure-resource-manager/management/manage-resources-powershell.md [Using the Azure CLI for Mac, Linux, and Windows with Azure Resource Management]: ../azure-resource-manager/management/manage-resources-cli.md [Recommended naming conventions for Azure resources]: /azure/cloud-adoption-framework/ready/azure-best-practices/naming-and-tagging [Service Bus namespace with topic, subscription, and rule]: https://github.com/Azure/azure-quickstart-templates/blob/master/quickstarts/microsoft.servicebus/servicebus-create-topic-subscription-rule/ [Service Bus queues, topics, and subscriptions]: service-bus-queues-topics-subscriptions.md
Success! Branch created successfully. Create Pull Request on GitHub
Error: