Service Bus deploy template and doc
This commit is contained in:
parent
ed0e548e2d
commit
ec7a251839
33
deploy/az/servicebus/readme.md
Normal file
33
deploy/az/servicebus/readme.md
Normal file
@ -0,0 +1,33 @@
|
||||
# Deploying Azure Service Bus
|
||||
|
||||
The ARM template `sbusdeploy.json` and its parameter file (`sbusdeploy.parameters.json`) are used to deploy following resources:
|
||||
|
||||
1. One Service Bus namespace
|
||||
2. One Service Bus
|
||||
3. Subscriptions used by application
|
||||
|
||||
## Editing sbusdeploy.parameters.json file
|
||||
|
||||
You can edit the `sbusdeploy.parameters.parameters.json` file to set your values, but is not needed. The only parameter than can
|
||||
be set is:
|
||||
|
||||
1. `namespaceprefix` is a string that is used to create the namespace. ARM script creates unique values by appending a unique string to this parameter value, so you can leave the default value.
|
||||
|
||||
## Deploy the template
|
||||
|
||||
Once parameter file is edited you can deploy it using [create-resources script](../readme.md).
|
||||
|
||||
i. e. if you are in windows, to deploy sql databases in a new resourcegroup located in westus, go to `deploy\az` folder and type:
|
||||
|
||||
```
|
||||
create-resources.cmd servicebus\sbusdeploy newResourceGroup -c westus
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
145
deploy/az/servicebus/sbusdeploy.json
Normal file
145
deploy/az/servicebus/sbusdeploy.json
Normal file
@ -0,0 +1,145 @@
|
||||
{
|
||||
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"parameters": {
|
||||
"namespaceprefix": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "Name of the Service Bus namespace"
|
||||
}
|
||||
}
|
||||
},
|
||||
"variables": {
|
||||
"serviceBusTopicName": "eshop_event_bus",
|
||||
"BasketSubscriptionName": "Basket",
|
||||
"CatalogSubscriptionName": "Catalog",
|
||||
"OrderingSubscriptionName": "Ordering",
|
||||
"location": "[resourceGroup().location]",
|
||||
"sbVersion": "2015-08-01",
|
||||
"defaultSASKeyName": "Root",
|
||||
"namespace":"[concat(parameters('namespaceprefix'), uniqueString(resourceGroup().id))]",
|
||||
"authRuleResourceId": "[resourceId('Microsoft.ServiceBus/namespaces/topics/authorizationRules', variables('namespace'), variables('serviceBusTopicName'), variables('defaultSASKeyName'))]"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"apiVersion": "[variables('sbVersion')]",
|
||||
"name": "[variables('namespace')]",
|
||||
"type": "Microsoft.ServiceBus/Namespaces",
|
||||
"location": "[variables('location')]",
|
||||
"sku": {
|
||||
"name": "Standard",
|
||||
"tier": "Standard"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"apiVersion": "[variables('sbVersion')]",
|
||||
"name": "[variables('serviceBusTopicName')]",
|
||||
"type": "Topics",
|
||||
"dependsOn": [
|
||||
"[concat('Microsoft.ServiceBus/namespaces/', variables('namespace'))]"
|
||||
],
|
||||
"properties": {
|
||||
"path": "[variables('serviceBusTopicName')]",
|
||||
"defaultMessageTimeToLive": "14.00:00:00",
|
||||
"maxSizeInMegabytes": 1024,
|
||||
"requiresDuplicateDetection": false,
|
||||
"enableBatchedOperations": true,
|
||||
"sizeInBytes": 0,
|
||||
"filteringMessagesBeforePublishing": false,
|
||||
"isAnonymousAccessible": false,
|
||||
"status": "Active",
|
||||
"supportOrdering": false,
|
||||
"autoDeleteOnIdle": "10675199.02:48:05.4775807",
|
||||
"enablePartitioning": true,
|
||||
"isExpress": false,
|
||||
"enableSubscriptionPartitioning": false,
|
||||
"enableExpress": false
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"type": "AuthorizationRules",
|
||||
"name": "[variables('defaultSASKeyName')]",
|
||||
"apiVersion": "[variables('sbVersion')]",
|
||||
"properties": {
|
||||
"rights": [
|
||||
"Manage",
|
||||
"Send",
|
||||
"Listen"
|
||||
]
|
||||
},
|
||||
"dependsOn": [
|
||||
"[variables('serviceBusTopicName')]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"apiVersion": "[variables('sbVersion')]",
|
||||
"name": "[variables('BasketSubscriptionName')]",
|
||||
"type": "Subscriptions",
|
||||
"dependsOn": [
|
||||
"[variables('serviceBusTopicName')]"
|
||||
],
|
||||
"properties": {
|
||||
"lockDuration": "00:00:30",
|
||||
"requiresSession": false,
|
||||
"defaultMessageTimeToLive": "14.00:00:00",
|
||||
"deadLetteringOnMessageExpiration": true,
|
||||
"deadLetteringOnFilterEvaluationExceptions": true,
|
||||
"maxDeliveryCount": 10,
|
||||
"enableBatchedOperations": false,
|
||||
"status": "Active",
|
||||
"autoDeleteOnIdle": "10675199.02:48:05.4775807",
|
||||
"entityAvailabilityStatus": "Available"
|
||||
}
|
||||
},
|
||||
{
|
||||
"apiVersion": "[variables('sbVersion')]",
|
||||
"name": "[variables('OrderingSubscriptionName')]",
|
||||
"type": "Subscriptions",
|
||||
"dependsOn": [
|
||||
"[variables('serviceBusTopicName')]"
|
||||
],
|
||||
"properties": {
|
||||
"lockDuration": "00:00:30",
|
||||
"requiresSession": false,
|
||||
"defaultMessageTimeToLive": "14.00:00:00",
|
||||
"deadLetteringOnMessageExpiration": true,
|
||||
"deadLetteringOnFilterEvaluationExceptions": true,
|
||||
"maxDeliveryCount": 10,
|
||||
"enableBatchedOperations": false,
|
||||
"status": "Active",
|
||||
"autoDeleteOnIdle": "10675199.02:48:05.4775807",
|
||||
"entityAvailabilityStatus": "Available"
|
||||
}
|
||||
},
|
||||
{
|
||||
"apiVersion": "[variables('sbVersion')]",
|
||||
"name": "[variables('CatalogSubscriptionName')]",
|
||||
"type": "Subscriptions",
|
||||
"dependsOn": [
|
||||
"[variables('serviceBusTopicName')]"
|
||||
],
|
||||
"properties": {
|
||||
"lockDuration": "00:00:30",
|
||||
"requiresSession": false,
|
||||
"defaultMessageTimeToLive": "14.00:00:00",
|
||||
"deadLetteringOnMessageExpiration": true,
|
||||
"deadLetteringOnFilterEvaluationExceptions": true,
|
||||
"maxDeliveryCount": 10,
|
||||
"enableBatchedOperations": false,
|
||||
"status": "Active",
|
||||
"autoDeleteOnIdle": "10675199.02:48:05.4775807",
|
||||
"entityAvailabilityStatus": "Available"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
"NamespaceConnectionString": {
|
||||
"type": "string",
|
||||
"value": "[listkeys(variables('authRuleResourceId'), variables('sbVersion')).primaryConnectionString]"
|
||||
}
|
||||
}
|
||||
}
|
9
deploy/az/servicebus/sbusdeploy.parameters.json
Normal file
9
deploy/az/servicebus/sbusdeploy.parameters.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"parameters": {
|
||||
"namespaceprefix": {
|
||||
"value": "eshopsb"
|
||||
}
|
||||
}
|
||||
}
|
@ -18,6 +18,7 @@ Using `docker-machine` is the recommended way to create a VM with docker install
|
||||
## Deploying Azure resources used by the services
|
||||
|
||||
1. [Deploying SQL Server and databases](az/sql/readme.md)
|
||||
2. [Deploying Azure Service Bus](az/servicebus/readme.md)
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user