|
20 | 20 | "metadata": {
|
21 | 21 | "description": "The application client ID used to run tests."
|
22 | 22 | }
|
| 23 | + }, |
| 24 | + "serviceBusEndpointSuffix": { |
| 25 | + "type": "string", |
| 26 | + "defaultValue": ".servicebus.windows.net", |
| 27 | + "metadata": { |
| 28 | + "description": "The url suffix to use when creating eventhubs connection strings." |
| 29 | + } |
| 30 | + }, |
| 31 | + "location": { |
| 32 | + "type": "string", |
| 33 | + "defaultValue": "[resourceGroup().location]", |
| 34 | + "metadata": { |
| 35 | + "description": "The location of the resources. By default, this is the same as the resource group." |
| 36 | + } |
23 | 37 | }
|
24 | 38 | },
|
25 | 39 | "variables": {
|
|
38 | 52 | "partnerChannelName": "[concat(parameters('baseName'), 'partner-channel')]",
|
39 | 53 | "partnerTopicName": "[concat(parameters('baseName'), 'partner-topic')]",
|
40 | 54 | "eventGridDataSenderRoleId": "d5a91429-5739-47e2-a06b-3470a27159e7",
|
41 |
| - "eventGridDataContributorRoleId": "1d8c3fe3-8864-474b-8749-01e3783e8157" |
| 55 | + "eventGridDataContributorRoleId": "1d8c3fe3-8864-474b-8749-01e3783e8157", |
| 56 | + "ehVersion": "2017-04-01", |
| 57 | + "contributorRoleId": "b24988ac-6180-42a0-ab88-20f7382dd24c", |
| 58 | + "eventHubsDataOwnerRoleId": "f526a384-b230-433a-b45c-95f59c4a2dec", |
| 59 | + "eventHubsNamespace": "[concat('eh-', parameters('baseName'))]", |
| 60 | + "eventHubName": "[concat('eh-', parameters('baseName'), '-hub')]", |
| 61 | + "eventHubAuthRuleName": "[concat('eh-', parameters('baseName'), '-hub-auth-rule')]", |
| 62 | + "serviceBusNamespace": "[concat('sb-', parameters('baseName'))]", |
| 63 | + "serviceBusSubscriptionName": "[concat('sb-', parameters('baseName'), '-subscription')]", |
| 64 | + "serviceBusTopicName": "[concat('sb-', parameters('baseName'), '-topic')]", |
| 65 | + "serviceBusQueueName": "[concat('sb-', parameters('baseName'), '-queue')]", |
| 66 | + "queueAuthorizationRuleName": "[concat('sb-', parameters('baseName'), '-queue-auth')]", |
| 67 | + "serviceBusSessionQueueName": "[concat('sb-', parameters('baseName'), '-session-queue')]", |
| 68 | + "sessionQueueAuthorizationRuleName": "[concat('sb-', parameters('baseName'), '-session-queue-auth')]", |
| 69 | + "serviceBusSessionId": "[concat('sb-', parameters('baseName'), '-session-queue-id')]", |
| 70 | + "defaultSASKeyName": "RootManageSharedAccessKey", |
| 71 | + "authRuleResourceId": "[resourceId('Microsoft.ServiceBus/namespaces/authorizationRules', variables('serviceBusNamespace'), variables('defaultSASKeyName'))]", |
| 72 | + "sbVersion": "2017-04-01", |
| 73 | + "serviceBusDataOwnerRoleId": "090c5cfd-751d-490a-894a-3ce6f1109419" |
42 | 74 | },
|
43 | 75 | "resources": [
|
44 | 76 | {
|
|
55 | 87 | "publicNetworkAccess": "Enabled"
|
56 | 88 | }
|
57 | 89 | },
|
| 90 | + { |
| 91 | + "apiVersion": "[variables('sbVersion')]", |
| 92 | + "name": "[variables('serviceBusNamespace')]", |
| 93 | + "type": "Microsoft.ServiceBus/Namespaces", |
| 94 | + "location": "[parameters('location')]", |
| 95 | + "sku": { |
| 96 | + "name": "Standard" |
| 97 | + }, |
| 98 | + "resources": [ |
| 99 | + { |
| 100 | + "apiVersion": "[variables('sbVersion')]", |
| 101 | + "name": "[variables('serviceBusTopicName')]", |
| 102 | + "type": "Topics", |
| 103 | + "dependsOn": [ |
| 104 | + "[concat('Microsoft.ServiceBus/namespaces/', variables('serviceBusNamespace'))]" |
| 105 | + ], |
| 106 | + "properties": { |
| 107 | + "path": "[variables('serviceBusTopicName')]" |
| 108 | + }, |
| 109 | + "resources": [{ |
| 110 | + "apiVersion": "[variables('sbVersion')]", |
| 111 | + "name": "[variables('serviceBusSubscriptionName')]", |
| 112 | + "type": "Subscriptions", |
| 113 | + "dependsOn": [ |
| 114 | + "[variables('serviceBusTopicName')]" |
| 115 | + ], |
| 116 | + "properties": {} |
| 117 | + }] |
| 118 | + }, |
| 119 | + { |
| 120 | + "type": "Queues", |
| 121 | + "apiVersion": "[variables('sbVersion')]", |
| 122 | + "name": "[variables('serviceBusQueueName')]", |
| 123 | + "dependsOn": [ |
| 124 | + "[resourceId('Microsoft.ServiceBus/namespaces', variables('serviceBusNamespace'))]" |
| 125 | + ], |
| 126 | + "properties": { |
| 127 | + "lockDuration": "PT5M", |
| 128 | + "maxSizeInMegabytes": 1024, |
| 129 | + "requiresDuplicateDetection": false, |
| 130 | + "requiresSession": false, |
| 131 | + "defaultMessageTimeToLive": "P10675199DT2H48M5.4775807S", |
| 132 | + "deadLetteringOnMessageExpiration": false, |
| 133 | + "duplicateDetectionHistoryTimeWindow": "PT10M", |
| 134 | + "maxDeliveryCount": 10, |
| 135 | + "autoDeleteOnIdle": "P10675199DT2H48M5.4775807S", |
| 136 | + "enablePartitioning": false, |
| 137 | + "enableExpress": false |
| 138 | + }, |
| 139 | + "resources": [ |
| 140 | + { |
| 141 | + "apiVersion": "[variables('sbVersion')]", |
| 142 | + "name": "[variables('queueAuthorizationRuleName')]", |
| 143 | + "type": "authorizationRules", |
| 144 | + "dependsOn": [ |
| 145 | + "[variables('serviceBusQueueName')]" |
| 146 | + ], |
| 147 | + "properties": { |
| 148 | + "Rights": ["Manage", "Send", "Listen"] |
| 149 | + } |
| 150 | + } |
| 151 | + ] |
| 152 | + }, |
| 153 | + { |
| 154 | + "type": "Queues", |
| 155 | + "apiVersion": "[variables('sbVersion')]", |
| 156 | + "name": "[variables('serviceBusSessionQueueName')]", |
| 157 | + "dependsOn": [ |
| 158 | + "[resourceId('Microsoft.ServiceBus/namespaces', variables('serviceBusNamespace'))]" |
| 159 | + ], |
| 160 | + "properties": { |
| 161 | + "lockDuration": "PT5M", |
| 162 | + "maxSizeInMegabytes": 1024, |
| 163 | + "requiresDuplicateDetection": false, |
| 164 | + "requiresSession": true, |
| 165 | + "defaultMessageTimeToLive": "P10675199DT2H48M5.4775807S", |
| 166 | + "deadLetteringOnMessageExpiration": false, |
| 167 | + "duplicateDetectionHistoryTimeWindow": "PT10M", |
| 168 | + "maxDeliveryCount": 10, |
| 169 | + "autoDeleteOnIdle": "P10675199DT2H48M5.4775807S", |
| 170 | + "enablePartitioning": false, |
| 171 | + "enableExpress": false |
| 172 | + }, |
| 173 | + "resources": [ |
| 174 | + { |
| 175 | + "apiVersion": "[variables('sbVersion')]", |
| 176 | + "name": "[variables('sessionQueueAuthorizationRuleName')]", |
| 177 | + "type": "authorizationRules", |
| 178 | + "dependsOn": [ |
| 179 | + "[variables('serviceBusSessionQueueName')]" |
| 180 | + ], |
| 181 | + "properties": { |
| 182 | + "Rights": ["Manage", "Send", "Listen"] |
| 183 | + } |
| 184 | + } |
| 185 | + ] |
| 186 | + } |
| 187 | + ], |
| 188 | + "properties": {} |
| 189 | + }, |
| 190 | + { |
| 191 | + "apiVersion": "[variables('ehVersion')]", |
| 192 | + "name": "[variables('eventHubsNamespace')]", |
| 193 | + "type": "Microsoft.EventHub/Namespaces", |
| 194 | + "location": "[parameters('location')]", |
| 195 | + "sku": { |
| 196 | + "name": "Standard", |
| 197 | + "tier": "Standard" |
| 198 | + }, |
| 199 | + "resources": [ |
| 200 | + { |
| 201 | + "type": "Microsoft.EventHub/namespaces/eventhubs", |
| 202 | + "apiVersion": "[variables('ehVersion')]", |
| 203 | + "name": "[concat(variables('eventHubsNamespace'), '/', variables('eventHubName'))]", |
| 204 | + "location": "[parameters('location')]", |
| 205 | + "dependsOn": [ |
| 206 | + "[resourceId('Microsoft.EventHub/namespaces', variables('eventHubsNamespace'))]" |
| 207 | + ], |
| 208 | + "properties": { |
| 209 | + "messageRetentionInDays": 7, |
| 210 | + "partitionCount": 1 |
| 211 | + }, |
| 212 | + "resources": [ |
| 213 | + { |
| 214 | + "apiVersion": "[variables('ehVersion')]", |
| 215 | + "name": "[variables('eventHubAuthRuleName')]", |
| 216 | + "type": "authorizationRules", |
| 217 | + "dependsOn": [ |
| 218 | + "[variables('eventHubName')]" |
| 219 | + ], |
| 220 | + "properties": { |
| 221 | + "Rights": ["Manage", "Send", "Listen"] |
| 222 | + } |
| 223 | + } |
| 224 | + ] |
| 225 | + } |
| 226 | + ], |
| 227 | + "properties": {} |
| 228 | + }, |
58 | 229 | {
|
59 | 230 | "type": "Microsoft.EventGrid/namespaces/topics",
|
60 | 231 | "apiVersion": "2024-06-01-preview",
|
|
229 | 400 | "principalId": "[parameters('testApplicationOid')]",
|
230 | 401 | "scope": "[resourceGroup().id]"
|
231 | 402 | }
|
| 403 | + }, |
| 404 | + { |
| 405 | + "type": "Microsoft.Authorization/roleAssignments", |
| 406 | + "apiVersion": "2019-04-01-preview", |
| 407 | + "name": "[guid(resourceGroup().id, deployment().name, parameters('baseName'), variables('eventHubsDataOwnerRoleId'), parameters('testApplicationOid'))]", |
| 408 | + "properties": { |
| 409 | + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', variables('eventHubsDataOwnerRoleId'))]", |
| 410 | + "principalId": "[parameters('testApplicationOid')]", |
| 411 | + "scope": "[resourceGroup().id]" |
| 412 | + } |
| 413 | + }, |
| 414 | + { |
| 415 | + "type": "Microsoft.Authorization/roleAssignments", |
| 416 | + "apiVersion": "2019-04-01-preview", |
| 417 | + "name": "[guid(resourceGroup().id, parameters('testApplicationOid'), variables('serviceBusDataOwnerRoleId'))]", |
| 418 | + "dependsOn": [ |
| 419 | + "[resourceId('Microsoft.ServiceBus/Namespaces', variables('serviceBusNamespace'))]" |
| 420 | + ], |
| 421 | + "properties": { |
| 422 | + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', variables('serviceBusDataOwnerRoleId'))]", |
| 423 | + "principalId": "[parameters('testApplicationOid')]", |
| 424 | + "scope": "[resourceGroup().id]" |
| 425 | + } |
| 426 | + }, |
| 427 | + { |
| 428 | + "type": "Microsoft.Authorization/roleAssignments", |
| 429 | + "apiVersion": "2019-04-01-preview", |
| 430 | + "name": "[guid(resourceGroup().id, parameters('testApplicationOid'), variables('contributorRoleId'))]", |
| 431 | + "dependsOn": [ |
| 432 | + "[resourceId('Microsoft.ServiceBus/Namespaces', variables('serviceBusNamespace'))]" |
| 433 | + ], |
| 434 | + "properties": { |
| 435 | + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', variables('contributorRoleId'))]", |
| 436 | + "principalId": "[parameters('testApplicationOid')]", |
| 437 | + "scope": "[resourceGroup().id]" |
| 438 | + } |
232 | 439 | }
|
233 | 440 | ],
|
234 | 441 | "outputs": {
|
|
307 | 514 | "AZURE_SUBSCRIPTION_ID": {
|
308 | 515 | "type": "string",
|
309 | 516 | "value": "[subscription().subscriptionId]"
|
310 |
| - } |
| 517 | + }, |
| 518 | + "EVENT_HUB_NAMESPACE": { |
| 519 | + "type": "string", |
| 520 | + "value": "[variables('eventHubsNamespace')]" |
| 521 | + }, |
| 522 | + "EVENT_HUB_HOSTNAME": { |
| 523 | + "type": "string", |
| 524 | + "value": "[concat(variables('eventHubsNamespace'), parameters('serviceBusEndpointSuffix'))]" |
| 525 | + }, |
| 526 | + "SERVICEBUS_FULLY_QUALIFIED_NAMESPACE": { |
| 527 | + "type": "string", |
| 528 | + "value": "[concat(variables('serviceBusNamespace'), parameters('serviceBusEndpointSuffix'))]" |
| 529 | + } |
311 | 530 | }
|
312 | 531 | }
|
0 commit comments