Last active
August 17, 2023 21:47
-
-
Save ryanfaircloth/d5154594a2bd84efd810a38222a84f5b to your computer and use it in GitHub Desktop.
azure eventhubs arm template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"eventHubNamespaceName": { | |
"type": "string", | |
"metadata": { | |
"description": "Name of the EventHub namespace" | |
} | |
}, | |
"eventhubSku": { | |
"type": "string", | |
"allowedValues": [ "Basic", "Standard" ], | |
"defaultValue": "Standard", | |
"metadata": { | |
"description": "The messaging tier for service Bus namespace" | |
} | |
}, | |
"skuCapacity": { | |
"type": "int", | |
"allowedValues": [ 1, 2, 4 ], | |
"defaultValue": 1, | |
"metadata": { | |
"description": "MessagingUnits for premium namespace" | |
} | |
}, | |
"isAutoInflateEnabled": { | |
"type": "string", | |
"defaultValue": "True", | |
"allowedValues": [ "True", "False" ], | |
"metadata": { | |
"description": "Enable or disable AutoInflate" | |
} | |
}, | |
"maximumThroughputUnits": { | |
"type": "int", | |
"defaultValue": 3, | |
"minValue": 1, | |
"maxValue": 20, | |
"metadata": { | |
"description": "Upper limit of throughput units when AutoInflate is enabled, vaule should be within 0 to 20 throughput units." | |
} | |
}, | |
"eventHubNameAzure": { | |
"type": "string", | |
"defaultValue": "azure", | |
"metadata": { | |
"description": "Name of the Event Hub" | |
} | |
}, | |
"eventHubNameAzureAD": { | |
"type": "string", | |
"defaultValue": "azuread", | |
"metadata": { | |
"description": "Name of the Event Hub" | |
} | |
}, | |
"eventHubNameDefender": { | |
"type": "string", | |
"defaultValue": "defender", | |
"metadata": { | |
"description": "Name of the Event Hub" | |
} | |
}, | |
"eventHubNameIntune": { | |
"type": "string", | |
"defaultValue": "intune", | |
"metadata": { | |
"description": "Name of the Event Hub" | |
} | |
}, | |
"messageRetentionInDays": { | |
"type": "int", | |
"defaultValue": 1, | |
"minValue": 1, | |
"maxValue": 7, | |
"metadata": { | |
"description": "How long to retain the data in Event Hub" | |
} | |
}, | |
"partitionCount": { | |
"type": "int", | |
"defaultValue": 32, | |
"minValue": 2, | |
"maxValue": 32, | |
"metadata": { | |
"description": "Number of partitions chosen" | |
} | |
}, | |
"location": { | |
"type": "string", | |
"defaultValue": "[resourceGroup().location]", | |
"metadata": { | |
"description": "Location for all resources." | |
} | |
} | |
}, | |
"variables": { | |
"defaultSASKeyName": "RootManageSharedAccessKey", | |
"authRuleResourceId": "[resourceId('Microsoft.EventHub/namespaces/authorizationRules', parameters('eventHubNamespaceName'), variables('defaultSASKeyName'))]" | |
}, | |
"resources": [ | |
{ | |
"apiVersion": "2018-01-01-preview", | |
"name": "[parameters('eventHubNamespaceName')]", | |
"type": "Microsoft.EventHub/Namespaces", | |
"location": "[parameters('location')]", | |
"sku": { | |
"name": "[parameters('eventhubSku')]", | |
"tier": "[parameters('eventhubSku')]", | |
"capacity": "[parameters('skuCapacity')]" | |
}, | |
"tags": { | |
"tag1": "value1", | |
"tag2": "value2" | |
}, | |
"properties": { | |
"isAutoInflateEnabled": "[parameters('isAutoInflateEnabled')]", | |
"maximumThroughputUnits": "[parameters('maximumThroughputUnits')]" | |
}, | |
"resources": [ | |
{ | |
"apiVersion": "2017-04-01", | |
"name": "[parameters('eventHubNameAzure')]", | |
"type": "eventhubs", | |
"dependsOn": [ | |
"[resourceId('Microsoft.EventHub/namespaces/', parameters('eventHubNamespaceName'))]" | |
], | |
"properties": { | |
"messageRetentionInDays": "[parameters('messageRetentionInDays')]", | |
"partitionCount": "[parameters('partitionCount')]" | |
}, | |
"resources": [ | |
{ | |
"type": "consumergroups", | |
"apiVersion": "2017-04-01", | |
"name": "cwd", | |
"dependsOn": [ | |
"[resourceId('Microsoft.EventHub/namespaces/eventhubs/', parameters('eventHubNamespaceName'),parameters('eventHubNameAzure'))]" | |
], | |
"properties": { | |
"userMetadata": "string" | |
} | |
} | |
] | |
}, | |
{ | |
"apiVersion": "2017-04-01", | |
"name": "[parameters('eventHubNameAzureAD')]", | |
"type": "eventhubs", | |
"dependsOn": [ | |
"[resourceId('Microsoft.EventHub/namespaces/', parameters('eventHubNamespaceName'))]" | |
], | |
"properties": { | |
"messageRetentionInDays": "[parameters('messageRetentionInDays')]", | |
"partitionCount": "[parameters('partitionCount')]" | |
}, | |
"resources": [ | |
{ | |
"type": "consumergroups", | |
"apiVersion": "2017-04-01", | |
"name": "cwd", | |
"dependsOn": [ | |
"[resourceId('Microsoft.EventHub/namespaces/eventhubs/',parameters('eventHubNamespaceName'), parameters('eventHubNameAzureAD'))]" | |
], | |
"properties": { | |
"userMetadata": "string" | |
} | |
} | |
] | |
}, | |
{ | |
"apiVersion": "2017-04-01", | |
"name": "[parameters('eventHubNameDefender')]", | |
"type": "eventhubs", | |
"dependsOn": [ | |
"[resourceId('Microsoft.EventHub/namespaces/', parameters('eventHubNamespaceName'))]" | |
], | |
"properties": { | |
"messageRetentionInDays": "[parameters('messageRetentionInDays')]", | |
"partitionCount": "[parameters('partitionCount')]" | |
}, | |
"resources": [ | |
{ | |
"type": "consumergroups", | |
"apiVersion": "2017-04-01", | |
"name": "cwd", | |
"dependsOn": [ | |
"[resourceId('Microsoft.EventHub/namespaces/eventhubs/',parameters('eventHubNamespaceName'), parameters('eventHubNameDefender'))]" | |
], | |
"properties": { | |
"userMetadata": "string" | |
} | |
} | |
] | |
}, | |
{ | |
"apiVersion": "2017-04-01", | |
"name": "[parameters('eventHubNameIntune')]", | |
"type": "eventhubs", | |
"dependsOn": [ | |
"[resourceId('Microsoft.EventHub/namespaces/', parameters('eventHubNamespaceName'))]" | |
], | |
"properties": { | |
"messageRetentionInDays": "[parameters('messageRetentionInDays')]", | |
"partitionCount": "[parameters('partitionCount')]" | |
}, | |
"resources": [ | |
{ | |
"type": "consumergroups", | |
"apiVersion": "2017-04-01", | |
"name": "cwd", | |
"dependsOn": [ | |
"[resourceId('Microsoft.EventHub/namespaces/eventhubs/',parameters('eventHubNamespaceName'), parameters('eventHubNameIntune'))]" | |
], | |
"properties": { | |
"userMetadata": "string" | |
} | |
} | |
] | |
} | |
] | |
} | |
], | |
"outputs": { | |
"authRuleResourceId": { | |
"type": "string", | |
"value": "[variables('authRuleResourceId')]" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment