Deploy a Azure Service Bus Topic using ARM Template

 

Deploy a Azure Service Bus Topic using ARM Template with Deploy a Custom Template.

https://blogs.perficient.com/2016/03/29/azure-arm-template-create-service-bus-topic-with-subscription/

Login to Azure

URL: https://portal.azure.com

Username:    xxxxxxxxx@microsoft.com

Password:      **********

è After login to Azure in Search with Deploy a Custom Template and open it.


è Click on Build your own template in the editor

Create a json file with below code:

ex: 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

Ex: 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

 



Click on Create Button then after few seconds Azure Service Bus was Created as show below




Comments

Popular posts from this blog

Basic Plugin Code in D365 using C#

CURD (Create, Update, Retrieve and Delete) Operation in D365 using Power Shell Script

Meta Data Using WebApiRequest