/
azuredeploy.json
112 lines (112 loc) · 3.5 KB
/
azuredeploy.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"adminUsername": {
"type": "string",
"metadata": {
"description": "Admin username for all VMs"
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Admin password for all VMs"
}
},
"numberOfVMSS": {
"type": "int",
"maxValue": 5,
"metadata": {
"description": "Number of VMSSes to deploy (max of 5)"
}
},
"instanceCountPerVMSS": {
"type": "int",
"maxValue": 100,
"metadata": {
"description": "Number of VM instances per scale set (max of 100)"
}
},
"_artifactsLocation": {
"type": "string",
"metadata": {
"description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated."
},
"defaultValue": "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/301-multi-vmss-linux"
},
"_artifactsLocationSasToken": {
"type": "securestring",
"metadata": {
"description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated."
},
"defaultValue": ""
}
},
"variables": {
"VMSSPrefix": "vmss-linux",
"newVNETName": "[concat(variables('VMSSPrefix'), '-vnet')]",
"addressPrefix": "10.0.0.0/16",
"subnetName": "subnet",
"subnetPrefix": "10.0.0.0/16"
},
"resources": [
{
"apiVersion": "2016-03-30",
"type": "Microsoft.Network/virtualNetworks",
"name": "[variables('newVNETName')]",
"location": "[resourceGroup().location]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('addressPrefix')]"
]
},
"subnets": [
{
"name": "[variables('subnetName')]",
"properties": {
"addressPrefix": "[variables('subnetPrefix')]"
}
}
]
}
},
{
"name": "[concat('clusterSet', copyindex())]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2016-02-01",
"copy": {
"name": "deploymentLoop",
"count": "[parameters('numberOfVMSS')]"
},
"dependsOn": [
"[concat('Microsoft.Network/virtualNetworks/', variables('newVNETName'))]"
],
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[concat(parameters('_artifactsLocation'), '/nestedtemplates/base.json', parameters('_artifactsLocationSasToken'))]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"VMSSName": {
"value": "[concat(variables('VMSSPrefix'), padLeft(copyindex(), 2, '0'))]"
},
"instanceCount": {
"value": "[parameters('instanceCountPerVMSS')]"
},
"subnetId": {
"value": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('newVnetName'), variables('subnetName'))]"
},
"adminUsername": {
"value": "[parameters('adminUsername')]"
},
"adminPassword": {
"value": "[parameters('adminPassword')]"
}
}
}
}
]
}