Utilize an ARM Template to Deploy an Azure Service Bus Topic through the 'Deploy a Custom Template' method.
Login to Azure
Upon logging into Azure, locate the 'Deploy a Custom Template' option and proceed to open it.
Click on Build your own template in the editor.
Create a json file with below code.
Example. AzureDeploy.json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"serviceBusNamespaceName": {
"type": "string",
"metadata": {
"description": "Name of the Service Bus Namespace"
}
},
"serviceBusTopicName": {
"type": "string",
"metadata": {
"description": "Name of the Service Bus Topic"
}
},
"serviceBusTopicSubscriptionName": {
"type": "string",
"metadata": {
"description": "Name of the Service Bus Topic Subscription"
}
}
},
"variables": {
"sbVersion": "2015-08-01"
},
"resources": [
{
"apiVersion": "[variables('sbVersion')]",
"name": "[parameters('serviceBusNamespaceName')]",
"type": "Microsoft.ServiceBus/namespaces",
"location": "[resourceGroup().location]",
"properties": {},
"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('serviceBusTopicSubscriptionName')]",
"type": "Subscriptions",
"dependsOn": [
"[parameters('serviceBusTopicName')]"
],
"properties": {},
"resources": []
}
]
}
]
}
],
"outputs": {}
}
Click on Load file and upload above created json file AzureDeploy.json.
As seen below.
After Uploaded file click on Save button
Create Another json file
Example. AzureDeploy-Dev.Parameters.json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"environment": {
"value": "dev"
},
"resourceGroupIndex": {
"value": "003"
},
"resourceGroupName": {
"value": "Demo"
},
"serviceBusNamespaceName": {
"value": "testapy003"
},
"serviceBusTopicName": {
"value": "apytest-003"
},
"serviceBusTopicSubscriptionName": {
"value": "apysubName"
}
}
}
After creating a json file.
Click on Edit parameters button as seen below:
After uploading the file seen below.
Click on Review + Create button
Select the "Create" button, and after a short duration, observe the successful creation of Azure Service Bus as displayed below.