-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent-hub.json
90 lines (90 loc) · 2.83 KB
/
event-hub.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"eventHubsNamespaceName": {
"type": "string",
"defaultValue": "ResurfaceEH",
"metadata": {
"description": "Name of EventHubs namespace"
}
},
"eventHubsSku": {
"type": "string",
"allowedValues": [ "Basic", "Standard" ],
"defaultValue": "Basic",
"metadata": {
"description": "The messaging tier for service Bus namespace"
}
},
"skuCapacity": {
"type": "int",
"minValue": 1,
"maxValue": 20,
"defaultValue": 1,
"metadata": {
"description": "Throughput Units for given namespace"
}
},
"eventHubsInstanceName": {
"type": "string",
"defaultValue": "apimlogs",
"metadata": {
"description": "Name of the EventHubs instance"
}
}
},
"resources": [
{
"apiVersion": "2017-04-01",
"name": "[parameters('eventHubsNamespaceName')]",
"type": "Microsoft.EventHub/namespaces",
"location": "[resourceGroup().location]",
"sku": {
"name": "[parameters('eventHubsSku')]",
"tier": "[parameters('eventHubsSku')]",
"capacity": "[parameters('skuCapacity')]"
},
"properties": {},
"resources": [
{
"apiVersion": "2017-04-01",
"type": "eventhubs",
"name": "[parameters('eventHubsInstanceName')]",
"dependsOn": [
"[resourceId('Microsoft.EventHub/namespaces/', parameters('eventHubsNamespaceName'))]"
],
"properties": {
"messageRetentionInDays": 1,
"partitionCount": 2
},
"resources": [
{
"apiVersion": "2021-11-01",
"type": "authorizationRules",
"name": "listenpolicy",
"dependsOn": [
"[resourceId('Microsoft.EventHub/namespaces/eventhubs/', parameters('eventHubsNamespaceName'), parameters('eventHubsInstanceName'))]"
],
"properties": {
"rights": [
"Listen"
]
}
}
]
}
]
}
],
"outputs": {
"eventHubName": {
"type": "string",
"value": "[parameters('eventHubsInstanceName')]"
},
"azureEventHubConnectionString": {
"type": "string",
"value": "[listkeys(resourceId('Microsoft.EventHub/namespaces/eventhubs/authorizationRules', parameters('eventHubsNamespaceName'), parameters('eventHubsInstanceName'), 'listenpolicy'), '2017-04-01').primaryConnectionString]"
}
}
}