This is how I solved it (including creating the authorization rule):
Define the variables:
...
"variables": {
"eventHubNamespaceName": "myehubns",
"eventHubName": "myehub",
"eventhubSendAuthorizationRuleName": "SendOnly",
"eventHubSendRuleId": "[resourceId('Microsoft.EventHub/namespaces/eventhubs/authorizationRules', variables('eventHubNamespaceName'),variables('eventHubName'), variables('eventhubSendAuthorizationRuleName'))]"
}
Create the Authorization Rule:
...
"resources": [{
"apiVersion": "2017-04-01",
"name": "[variables('eventhubSendAuthorizationRuleName')]",
"type": "authorizationRules",
"dependsOn": [
"[concat('Microsoft.EventHub/namespaces/', variables('eventHubNamespaceName'),'/eventhubs/',variables('eventHubName'))]"
],
"properties": {
"rights": [
"Send"
]
}
}
]
Retrieve the primary Connection String of the previous created rule:
"EventHubConnectionstring": "[listkeys(variables('eventHubSendRuleId'), '2017-04-01').primaryConnectionString]"