From 773e2728643e8641d53c9151f9172f200f8e985c Mon Sep 17 00:00:00 2001 From: Zeeshan Sayyed Date: Thu, 18 Aug 2016 17:36:50 -0700 Subject: [PATCH 1/3] Adding template for AuthRules in EH --- .../azuredeploy.json | 23 ++-- .../azuredeploy.parameters.json | 8 +- .../metadata.json | 2 +- 201-servicebus-create-queue/azuredeploy.json | 1 - .../azuredeploy.json | 1 - .../README.md | 5 + .../azuredeploy.json | 124 ++++++++++++++++++ .../azuredeploy.parameters.json | 18 +++ .../metadata.json | 7 + .../azuredeploy.json | 81 ++++++------ 10 files changed, 207 insertions(+), 63 deletions(-) create mode 100644 301-eventHub-create-authrule-namespace-and-eventHub/README.md create mode 100644 301-eventHub-create-authrule-namespace-and-eventHub/azuredeploy.json create mode 100644 301-eventHub-create-authrule-namespace-and-eventHub/azuredeploy.parameters.json create mode 100644 301-eventHub-create-authrule-namespace-and-eventHub/metadata.json diff --git a/201-servicebus-create-eventhub-and-consumergroup/azuredeploy.json b/201-servicebus-create-eventhub-and-consumergroup/azuredeploy.json index 1c1229e3ab7a..ff21ee8a2681 100644 --- a/201-servicebus-create-eventhub-and-consumergroup/azuredeploy.json +++ b/201-servicebus-create-eventhub-and-consumergroup/azuredeploy.json @@ -2,25 +2,25 @@ "$schema":"http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#", "contentVersion":"1.0.0.0", "parameters":{ - "serviceBusNamespaceName":{ + "namespaceName":{ "type":"string", "metadata":{ "description":"Name of the EventHub namespace" } }, - "serviceBusEventHubName":{ + "eventHubName":{ "type":"string", "metadata":{ "description":"Name of the Event Hub" } }, - "serviceBusConsumerGroupName":{ + "consumerGroupName":{ "type":"string", "metadata":{ "description":"Name of the Consumer Group" } }, - "serviceBusApiVersion":{ + "apiVersion":{ "type":"string", "defaultValue":"2015-08-01", "metadata":{ @@ -32,15 +32,14 @@ "location":"[resourceGroup().location]", "ehVersion":"[parameters('serviceBusApiVersion')]", "defaultSASKeyName":"RootManageSharedAccessKey", - "authRuleResourceId":"[resourceId('Microsoft.EventHub/namespaces/authorizationRules', parameters('serviceBusNamespaceName'), variables('defaultSASKeyName'))]" + "authRuleResourceId":"[resourceId('Microsoft.EventHub/namespaces/authorizationRules', parameters('namespaceName'), variables('defaultSASKeyName'))]" }, "resources":[ { "apiVersion":"[variables('ehVersion')]", - "name":"[parameters('serviceBusNamespaceName')]", + "name":"[parameters('namespaceName')]", "type":"Microsoft.EventHub/Namespaces", "location":"[variables('location')]", - "kind":"EventHub", "sku":{ "name":"Standard", "tier":"Standard" @@ -48,21 +47,21 @@ "resources":[ { "apiVersion":"[variables('ehVersion')]", - "name":"[parameters('serviceBusEventHubName')]", + "name":"[parameters('eventHubName')]", "type":"EventHubs", "dependsOn":[ - "[concat('Microsoft.EventHub/namespaces/', parameters('serviceBusNamespaceName'))]" + "[concat('Microsoft.EventHub/namespaces/', parameters('namespaceName'))]" ], "properties":{ - "path":"[parameters('serviceBusEventHubName')]" + "path":"[parameters('eventHubName')]" }, "resources":[ { "apiVersion":"[variables('ehVersion')]", - "name":"[parameters('serviceBusConsumerGroupName')]", + "name":"[parameters('consumerGroupName')]", "type":"ConsumerGroups", "dependsOn":[ - "[parameters('serviceBusEventHubName')]" + "[parameters('eventHubName')]" ], "properties":{ diff --git a/201-servicebus-create-eventhub-and-consumergroup/azuredeploy.parameters.json b/201-servicebus-create-eventhub-and-consumergroup/azuredeploy.parameters.json index f0b9bb4c40aa..26f5ee4d6ba0 100644 --- a/201-servicebus-create-eventhub-and-consumergroup/azuredeploy.parameters.json +++ b/201-servicebus-create-eventhub-and-consumergroup/azuredeploy.parameters.json @@ -2,16 +2,16 @@ "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { - "serviceBusNamespaceName": { + "namespaceName": { "value": "GEN-UNIQUE" }, - "serviceBusEventHubName": { + "eventHubName": { "value": "GEN-UNIQUE" }, - "serviceBusConsumerGroupName": { + "consumerGroupName": { "value": "GEN-UNIQUE" }, - "serviceBusApiVersion": { + "apiVersion": { "value": "2015-08-01" } } diff --git a/201-servicebus-create-eventhub-and-consumergroup/metadata.json b/201-servicebus-create-eventhub-and-consumergroup/metadata.json index ee6149aea79b..4d9a0b261269 100644 --- a/201-servicebus-create-eventhub-and-consumergroup/metadata.json +++ b/201-servicebus-create-eventhub-and-consumergroup/metadata.json @@ -3,5 +3,5 @@ "description": "This template enables you to deploy a EventHubs Standard namespace, an Event Hub, and a consumer group.", "summary": "This template creates a EventHubs namespace, an Event Hub, and a consumer group.", "githubUsername": "sazeesha", - "dateUpdated": "2016-07-26" + "dateUpdated": "2016-08-18" } \ No newline at end of file diff --git a/201-servicebus-create-queue/azuredeploy.json b/201-servicebus-create-queue/azuredeploy.json index 110b18e61747..93ad613eb958 100644 --- a/201-servicebus-create-queue/azuredeploy.json +++ b/201-servicebus-create-queue/azuredeploy.json @@ -33,7 +33,6 @@ "name": "[parameters('serviceBusNamespaceName')]", "type": "Microsoft.ServiceBus/Namespaces", "location": "[variables('location')]", - "kind": "Messaging", "sku": { "name": "Standard", "tier": "Standard" diff --git a/201-servicebus-create-topic-and-subscription/azuredeploy.json b/201-servicebus-create-topic-and-subscription/azuredeploy.json index 7d36f379f6d5..1bd8b8179bdf 100644 --- a/201-servicebus-create-topic-and-subscription/azuredeploy.json +++ b/201-servicebus-create-topic-and-subscription/azuredeploy.json @@ -39,7 +39,6 @@ "name": "[parameters('serviceBusNamespaceName')]", "type": "Microsoft.ServiceBus/Namespaces", "location": "[variables('location')]", - "kind": "Messaging", "sku": { "name": "Standard", "tier": "Standard" diff --git a/301-eventHub-create-authrule-namespace-and-eventHub/README.md b/301-eventHub-create-authrule-namespace-and-eventHub/README.md new file mode 100644 index 000000000000..2026660a997e --- /dev/null +++ b/301-eventHub-create-authrule-namespace-and-eventHub/README.md @@ -0,0 +1,5 @@ +# 301-eventHub-create-authrule-namespace-and-eventHub + + + + \ No newline at end of file diff --git a/301-eventHub-create-authrule-namespace-and-eventHub/azuredeploy.json b/301-eventHub-create-authrule-namespace-and-eventHub/azuredeploy.json new file mode 100644 index 000000000000..d5c6c2dfab85 --- /dev/null +++ b/301-eventHub-create-authrule-namespace-and-eventHub/azuredeploy.json @@ -0,0 +1,124 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "namespaceName": { + "type": "string", + "metadata": { + "description": "Name of the EventHub namespace" + } + }, + "eventHubName": { + "type": "string", + "metadata": { + "description": "Name of the Event Hub" + } + }, + "consumerGroupName": { + "type": "string", + "metadata": { + "description": "Name of the Consumer Group" + } + }, + "apiVersion": { + "type": "string", + "defaultValue": "2015-08-01", + "metadata": { + "description": "ApiVersion used by the template" + } + } + }, + "variables": { + "managePolicy": "ManagePolicy", + "sendPolicy": "SendPolicy", + "listenPolicy": "ListenPolicy", + "location": "[resourceGroup().location]", + "ehVersion": "[parameters('apiVersion')]", + "defaultSASKeyName": "RootManageSharedAccessKey", + "authRuleResourceId": "[resourceId('Microsoft.EventHub/namespaces/authorizationRules', parameters('namespaceName'), variables('defaultSASKeyName'))]" + }, + "resources": [{ + "apiVersion": "[variables('ehVersion')]", + "name": "[parameters('namespaceName')]", + "type": "Microsoft.EventHub/Namespaces", + "location": "[variables('location')]", + "sku": { + "name": "Standard", + "tier": "Standard" + }, + "resources": [{ + "apiVersion": "[variables('ehVersion')]", + "name": "[parameters('eventHubName')]", + "type": "EventHubs", + "dependsOn": [ + "[concat('Microsoft.EventHub/namespaces/', parameters('namespaceName'))]" + ], + "properties": { + "path": "[parameters('eventHubName')]" + }, + "resources": [{ + "apiVersion": "[variables('ehVersion')]", + "name": "[parameters('consumerGroupName')]", + "type": "ConsumerGroups", + "dependsOn": [ + "[concat('Microsoft.EventHub/namespaces/', parameters('namespaceName'),'/eventhubs/',parameters('eventHubName'))]" + ], + "properties": {} + }, { + "apiVersion": "[variables('ehVersion')]", + "name": "[variables('managePolicy')]", + "type": "authorizationRules", + "dependsOn": [ + "[concat('Microsoft.EventHub/namespaces/', parameters('namespaceName'),'/eventhubs/',parameters('eventHubName'))]", + "[concat('Microsoft.EventHub/namespaces/', parameters('namespaceName'),'/eventhubs/',parameters('eventHubName'), '/consumerGroups/', parameters('consumerGroupName'))]" + ], + "properties": { + "Rights": [ + "Send", + "Listen", + "Manage" + ] + } + }, { + "apiVersion": "[variables('ehVersion')]", + "name": "[variables('sendPolicy')]", + "type": "authorizationRules", + "dependsOn": [ + "[concat('Microsoft.EventHub/namespaces/', parameters('namespaceName'),'/eventhubs/',parameters('eventHubName'))]", + "[concat('Microsoft.EventHub/namespaces/', parameters('namespaceName'),'/eventhubs/',parameters('eventHubName'), '/authorizationRules/', variables('managePolicy'))]", + "[concat('Microsoft.EventHub/namespaces/', parameters('namespaceName'),'/eventhubs/',parameters('eventHubName'), '/consumerGroups/', parameters('consumerGroupName'))]" + ], + "properties": { + "Rights": [ + "Send" + ] + } + }, { + "apiVersion": "[variables('ehVersion')]", + "name": "[variables('listenPolicy')]", + "type": "authorizationRules", + "dependsOn": [ + "[concat('Microsoft.EventHub/namespaces/', parameters('namespaceName'),'/eventhubs/',parameters('eventHubName'))]", + "[concat('Microsoft.EventHub/namespaces/', parameters('namespaceName'),'/eventhubs/',parameters('eventHubName'), '/authorizationRules/', variables('managePolicy'))]", + "[concat('Microsoft.EventHub/namespaces/', parameters('namespaceName'),'/eventhubs/',parameters('eventHubName'), '/authorizationRules/', variables('sendPolicy'))]", + "[concat('Microsoft.EventHub/namespaces/', parameters('namespaceName'),'/eventhubs/',parameters('eventHubName'), '/consumerGroups/', parameters('consumerGroupName'))]" + ], + "properties": { + "Rights": [ + "Listen" + ] + } + }] + }] + }], + "outputs": { + "NamespaceConnectionString": { + "type": "string", + "value": "[listkeys(variables('authRuleResourceId'), variables('ehVersion')).primaryConnectionString]" + }, + "SharedAccessPolicyPrimaryKey": { + "type": "string", + "value": "[listkeys(variables('authRuleResourceId'), variables('ehVersion')).primaryKey]" + } + } +} \ No newline at end of file diff --git a/301-eventHub-create-authrule-namespace-and-eventHub/azuredeploy.parameters.json b/301-eventHub-create-authrule-namespace-and-eventHub/azuredeploy.parameters.json new file mode 100644 index 000000000000..26f5ee4d6ba0 --- /dev/null +++ b/301-eventHub-create-authrule-namespace-and-eventHub/azuredeploy.parameters.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "namespaceName": { + "value": "GEN-UNIQUE" + }, + "eventHubName": { + "value": "GEN-UNIQUE" + }, + "consumerGroupName": { + "value": "GEN-UNIQUE" + }, + "apiVersion": { + "value": "2015-08-01" + } + } +} \ No newline at end of file diff --git a/301-eventHub-create-authrule-namespace-and-eventHub/metadata.json b/301-eventHub-create-authrule-namespace-and-eventHub/metadata.json new file mode 100644 index 000000000000..a66dd6871544 --- /dev/null +++ b/301-eventHub-create-authrule-namespace-and-eventHub/metadata.json @@ -0,0 +1,7 @@ +{ + "itemDisplayName": "Create EventHubs namespace, Event Hub, consumer group and authorizationRules", + "description": "This template enables you to deploy a EventHubs Standard namespace, an Event Hub, a consumer group and authorizationRules", + "summary": "This template creates a EventHubs namespace, an Event Hub, a consumer group and authorizationRules", + "githubUsername": "sazeesha", + "dateUpdated": "2016-08-18" +} \ No newline at end of file diff --git a/301-servicebus-create-authrule-namespace-and-queue/azuredeploy.json b/301-servicebus-create-authrule-namespace-and-queue/azuredeploy.json index 4ad8ecf27c82..07a6acf9a5d0 100644 --- a/301-servicebus-create-authrule-namespace-and-queue/azuredeploy.json +++ b/301-servicebus-create-authrule-namespace-and-queue/azuredeploy.json @@ -41,54 +41,47 @@ "nsAuthorizationRuleResourceId": "[resourceId('Microsoft.ServiceBus/namespaces/authorizationRules', parameters('serviceBusNamespaceName'), parameters('namespaceAuthorizationRuleName'))]", "ehAuthorizationRuleResourceId": "[resourceId('Microsoft.ServiceBus/namespaces/queues/authorizationRules', parameters('serviceBusNamespaceName'), parameters('serviceBusQueueName'), parameters('queueAuthorizationRuleName'))]" }, - "resources": [ - { + "resources": [{ + "apiVersion": "[variables('sbVersion')]", + "name": "[parameters('serviceBusNamespaceName')]", + "type": "Microsoft.ServiceBus/namespaces", + "location": "[variables('location')]", + "sku": { + "name": "Standard", + "tier": "Standard" + }, + "resources": [{ "apiVersion": "[variables('sbVersion')]", - "name": "[parameters('serviceBusNamespaceName')]", - "type": "Microsoft.ServiceBus/namespaces", - "location": "[variables('location')]", - "kind": "Messaging", - "sku": { - "name": "Standard", - "tier": "Standard" + "name": "[parameters('serviceBusQueueName')]", + "type": "Queues", + "dependsOn": [ + "[concat('Microsoft.ServiceBus/namespaces/', parameters('serviceBusNamespaceName'))]" + ], + "properties": { + "path": "[parameters('serviceBusQueueName')]" }, - "resources": [ - { - "apiVersion": "[variables('sbVersion')]", - "name": "[parameters('serviceBusQueueName')]", - "type": "Queues", - "dependsOn": [ - "[concat('Microsoft.ServiceBus/namespaces/', parameters('serviceBusNamespaceName'))]" - ], - "properties": { - "path": "[parameters('serviceBusQueueName')]" - }, - "resources": [ - { - "apiVersion": "[variables('sbVersion')]", - "name": "[parameters('queueAuthorizationRuleName')]", - "type": "authorizationRules", - "dependsOn": [ - "[parameters('serviceBusQueueName')]" - ], - "properties": { - "Rights": ["Listen"] - } - } - ] + "resources": [{ + "apiVersion": "[variables('sbVersion')]", + "name": "[parameters('queueAuthorizationRuleName')]", + "type": "authorizationRules", + "dependsOn": [ + "[parameters('serviceBusQueueName')]" + ], + "properties": { + "Rights": ["Listen"] } - ] - }, { - "apiVersion": "[variables('sbVersion')]", - "name": "[variables('namespaceAuthRuleName')]", - "type": "Microsoft.ServiceBus/namespaces/authorizationRules", - "dependsOn": ["[concat('Microsoft.ServiceBus/namespaces/', parameters('serviceBusNamespaceName'))]"], - "location": "[resourceGroup().location]", - "properties": { - "Rights": ["Send"] - } + }] + }] + }, { + "apiVersion": "[variables('sbVersion')]", + "name": "[variables('namespaceAuthRuleName')]", + "type": "Microsoft.ServiceBus/namespaces/authorizationRules", + "dependsOn": ["[concat('Microsoft.ServiceBus/namespaces/', parameters('serviceBusNamespaceName'))]"], + "location": "[resourceGroup().location]", + "properties": { + "Rights": ["Send"] } - ], + }], "outputs": { "NamespaceConnectionString": { "type": "string", From 5b7bbe92799c3da01f35639c2b6abf9bd1a03469 Mon Sep 17 00:00:00 2001 From: Zeeshan Sayyed Date: Fri, 19 Aug 2016 11:35:02 -0700 Subject: [PATCH 2/3] fix validations --- .../azuredeploy.json | 2 +- .../metadata.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/201-servicebus-create-eventhub-and-consumergroup/azuredeploy.json b/201-servicebus-create-eventhub-and-consumergroup/azuredeploy.json index ff21ee8a2681..948f251bf6bc 100644 --- a/201-servicebus-create-eventhub-and-consumergroup/azuredeploy.json +++ b/201-servicebus-create-eventhub-and-consumergroup/azuredeploy.json @@ -30,7 +30,7 @@ }, "variables":{ "location":"[resourceGroup().location]", - "ehVersion":"[parameters('serviceBusApiVersion')]", + "ehVersion":"[parameters('apiVersion')]", "defaultSASKeyName":"RootManageSharedAccessKey", "authRuleResourceId":"[resourceId('Microsoft.EventHub/namespaces/authorizationRules', parameters('namespaceName'), variables('defaultSASKeyName'))]" }, diff --git a/301-eventHub-create-authrule-namespace-and-eventHub/metadata.json b/301-eventHub-create-authrule-namespace-and-eventHub/metadata.json index a66dd6871544..a439440209c6 100644 --- a/301-eventHub-create-authrule-namespace-and-eventHub/metadata.json +++ b/301-eventHub-create-authrule-namespace-and-eventHub/metadata.json @@ -1,5 +1,5 @@ { - "itemDisplayName": "Create EventHubs namespace, Event Hub, consumer group and authorizationRules", + "itemDisplayName": "Create EventHubs authorizationRules", "description": "This template enables you to deploy a EventHubs Standard namespace, an Event Hub, a consumer group and authorizationRules", "summary": "This template creates a EventHubs namespace, an Event Hub, a consumer group and authorizationRules", "githubUsername": "sazeesha", From 0638bbe1ac1430301d8091b6774c3061e9109a81 Mon Sep 17 00:00:00 2001 From: Zeeshan Sayyed Date: Mon, 22 Aug 2016 13:54:09 -0700 Subject: [PATCH 3/3] addressing PR comments --- 301-eventHub-create-authrule-namespace-and-eventHub/README.md | 2 +- .../azuredeploy.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/301-eventHub-create-authrule-namespace-and-eventHub/README.md b/301-eventHub-create-authrule-namespace-and-eventHub/README.md index 2026660a997e..c6e4a604f4a2 100644 --- a/301-eventHub-create-authrule-namespace-and-eventHub/README.md +++ b/301-eventHub-create-authrule-namespace-and-eventHub/README.md @@ -1,4 +1,4 @@ -# 301-eventHub-create-authrule-namespace-and-eventHub +# Create Event Hub namespace, an Event Hub, a consumer group and authorizationRules. diff --git a/301-eventHub-create-authrule-namespace-and-eventHub/azuredeploy.json b/301-eventHub-create-authrule-namespace-and-eventHub/azuredeploy.json index d5c6c2dfab85..71495814f1d7 100644 --- a/301-eventHub-create-authrule-namespace-and-eventHub/azuredeploy.json +++ b/301-eventHub-create-authrule-namespace-and-eventHub/azuredeploy.json @@ -1,5 +1,5 @@ { - "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#", + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "namespaceName": {