This template creates a EventHubs namespace, an Event Hub, a consumer group and authorizationRules
{"apiversion": "2018-01-01-preview", "name": "[parameters('namespacename')]", "type": "microsoft.eventhub/namespaces", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"isautoinflateenabled": true, "maximumthroughputunits": 7}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('eventhubname')]", "type": "eventhubs", "dependson": ["[resourceid('microsoft.eventhub/namespaces/", parameters('namespacename'))]"], "properties": {"messageretentionindays": 4, "partitioncount": 4}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('consumergroupname')]", "type": "consumergroups", "dependson": ["[resourceid('microsoft.eventhub/namespaces/eventhubs/", parameters('namespacename'),parameters('eventhubname'))]"], "properties": {"usermetadata": "user metadata"}}, {"apiversion": "2017-04-01", "name": "[parameters('eventhubauthorizationrulename')]", "type": "authorizationrules", "dependson": ["[resourceid('microsoft.eventhub/namespaces/eventhubs/", parameters('namespacename'),parameters('eventhubname'))]"], "properties": {"rights": ["send", "listen", "manage"]}}, {"apiversion": "2017-04-01", "name": "[parameters('eventhubauthorizationrulename1')]", "type": "authorizationrules", "dependson": ["[resourceid('microsoft.eventhub/namespaces/eventhubs/", parameters('namespacename'),parameters('eventhubname'))]"], "properties": {"rights": ["send"]}}]}]}{"apiversion": "2017-04-01", "name": "[concat(parameters('namespacename'), "/", parameters('namespaceauthorizationrulename'))]", "type": "microsoft.eventhub/namespaces/authorizationrules", "dependson": ["[resourceid('microsoft.eventhub/namespaces/", parameters('namespacename'))]"], "properties": {"rights": ["send", "listen", "manage"]}} 