Skip to content

Commit

Permalink
Merge pull request #2378 from sazeesha/master
Browse files Browse the repository at this point in the history
Adding template for AuthRules in EH
  • Loading branch information
gatneil authored Aug 23, 2016
2 parents 234fc29 + 0638bbe commit dff53cd
Show file tree
Hide file tree
Showing 10 changed files with 208 additions and 64 deletions.
25 changes: 12 additions & 13 deletions 201-servicebus-create-eventhub-and-consumergroup/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -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":{
Expand All @@ -30,39 +30,38 @@
},
"variables":{
"location":"[resourceGroup().location]",
"ehVersion":"[parameters('serviceBusApiVersion')]",
"ehVersion":"[parameters('apiVersion')]",
"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"
},
"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":{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
1 change: 0 additions & 1 deletion 201-servicebus-create-queue/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"name": "[parameters('serviceBusNamespaceName')]",
"type": "Microsoft.ServiceBus/Namespaces",
"location": "[variables('location')]",
"kind": "Messaging",
"sku": {
"name": "Standard",
"tier": "Standard"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"name": "[parameters('serviceBusNamespaceName')]",
"type": "Microsoft.ServiceBus/Namespaces",
"location": "[variables('location')]",
"kind": "Messaging",
"sku": {
"name": "Standard",
"tier": "Standard"
Expand Down
5 changes: 5 additions & 0 deletions 301-eventHub-create-authrule-namespace-and-eventHub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Create Event Hub namespace, an Event Hub, a consumer group and authorizationRules.

<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.luolix.top%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F301-eventHub-create-authrule-namespace-and-eventHub%2Fazuredeploy.json" target="_blank">
<img src="http://azuredeploy.net/deploybutton.png"/>
</a>
124 changes: 124 additions & 0 deletions 301-eventHub-create-authrule-namespace-and-eventHub/azuredeploy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/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]"
}
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"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",
"dateUpdated": "2016-08-18"
}
81 changes: 37 additions & 44 deletions 301-servicebus-create-authrule-namespace-and-queue/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit dff53cd

Please sign in to comment.