2 "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3 "contentVersion": "1.0.0.0",
5 "scriptURL": { "type": "string","metadata": { "description": "entrypoint script location" }},
6 "scriptName": { "type": "string", "metadata": { "description": "entrypoint script name"}},
7 "onapBranch": { "type": "string","metadata": { "description": "onap branch amsterdam or master" }},
8 "onapEnvironment": { "type": "string","metadata": { "description": "onap environment usually defaults to onap" }},
9 "vmName": { "type": "string","metadata": { "description": "Name of the VM" }},
10 "osType": { "type": "string", "allowedValues": ["Linux"], "metadata": { "description": "Type of OS" }},
11 "adminUsername": { "type": "string", "metadata": { "description": "User name for the VM" }},
12 "sshKeyData": { "type": "string", "metadata": { "description": "SSH rsa public key file as a string." }},
13 "dnsLabelPrefix": { "type": "string", "metadata": { "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." }},
14 "ubuntuOSVersion": { "type": "string", "defaultValue": "16.04.0-LTS", "allowedValues": ["16.04.0-LTS"], "metadata": { "description": "The OS"}},
15 "vmSize": { "type": "string",
16 "defaultValue": "Standard_D1",
27 "metadata": { "description": "VM size" }}
30 "storageAccountName": "[concat(uniquestring(resourceGroup().id), 'salinuxvm')]",
31 "imagePublisher": "Canonical",
32 "imageOffer": "UbuntuServer",
33 "nicName": "[concat(parameters('vmName'),'VMNic')]",
34 "addressPrefix": "10.0.0.0/16",
35 "subnetName": "Subnet",
36 "subnetPrefix": "10.0.0.0/24",
37 "storageAccountType": "Standard_LRS",
38 "publicIPAddressName": "[concat(parameters('vmName'),'PublicIP')]",
39 "publicIPAddressType": "Dynamic",
40 "virtualNetworkName": "[concat(parameters('vmName'),'VNET')]",
41 "vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]",
42 "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
43 "networkSecurityGroupName": "[concat(parameters('vmName'), '_obrien_local_nsg')]",
44 "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]"
48 "type": "Microsoft.Storage/storageAccounts",
49 "name": "[variables('storageAccountName')]",
50 "apiVersion": "2017-06-01",
51 "location": "[resourceGroup().location]",
52 "sku": { "name": "[variables('storageAccountType')]"},
57 "apiVersion": "2017-03-01",
58 "type": "Microsoft.Network/networkSecurityGroups",
59 "name": "[variables('networkSecurityGroupName')]",
60 "location": "[resourceGroup().location]",
61 "tags": { "displayName": "NSG" },
65 "name": "port_10249-10255_172",
67 "description": "port_10249-10255_172",
69 "sourcePortRange": "*",
70 "destinationPortRange": "10249-10255",
71 "sourceAddressPrefix": "172.17.0.1/32",
72 "destinationAddressPrefix": "*",
75 "direction": "Inbound"
79 "name": "port_10249-10255_127",
81 "description": "port_10249-10255_127",
83 "sourcePortRange": "*",
84 "destinationPortRange": "10249-10255",
85 "sourceAddressPrefix": "127.0.0.1/32",
86 "destinationAddressPrefix": "*",
89 "direction": "Inbound"
93 "name": "Port_10249-10255-block",
95 "description": "Port_10249-10255-block",
97 "sourcePortRange": "*",
98 "destinationPortRange": "10249-10255",
99 "sourceAddressPrefix": "Internet",
100 "destinationAddressPrefix": "*",
103 "direction": "Inbound"
109 "description": "All in",
111 "sourcePortRange": "*",
112 "destinationPortRange": "*",
113 "sourceAddressPrefix": "Internet",
114 "destinationAddressPrefix": "*",
117 "direction": "Inbound"
121 "name": "block-8080",
123 "description": "block-8080",
125 "sourcePortRange": "8080",
126 "destinationPortRange": "*",
127 "sourceAddressPrefix": "Internet",
128 "destinationAddressPrefix": "*",
131 "direction": "Outbound"
137 "description": "All out",
139 "sourcePortRange": "*",
140 "destinationPortRange": "*",
141 "sourceAddressPrefix": "Internet",
142 "destinationAddressPrefix": "*",
145 "direction": "Outbound"
152 "apiVersion": "2017-04-01",
153 "type": "Microsoft.Network/publicIPAddresses",
154 "name": "[variables('publicIPAddressName')]",
155 "location": "[resourceGroup().location]",
157 "publicIPAllocationMethod": "[variables('publicIPAddressType')]",
159 "domainNameLabel": "[concat(parameters('vmName'), parameters('dnsLabelPrefix'))]"
164 "apiVersion": "2017-04-01",
165 "type": "Microsoft.Network/virtualNetworks",
166 "name": "[variables('virtualNetworkName')]",
167 "location": "[resourceGroup().location]",
169 "[concat('Microsoft.Network/networkSecurityGroups/', variables('networkSecurityGroupName'))]"
173 "addressPrefixes": [ "[variables('addressPrefix')]" ]
177 "name": "[variables('subnetName')]",
179 "addressPrefix": "[variables('subnetPrefix')]",
180 "networkSecurityGroup": {
181 "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
189 "apiVersion": "2017-04-01",
190 "type": "Microsoft.Network/networkInterfaces",
191 "name": "[variables('nicName')]",
192 "location": "[resourceGroup().location]",
194 "[resourceId('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
195 "[resourceId('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
198 "ipConfigurations": [ {
201 "privateIPAllocationMethod": "Dynamic",
202 "publicIPAddress": { "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]" },
203 "subnet": { "id": "[variables('subnetRef')]" }
210 "apiVersion": "2017-03-30",
211 "type": "Microsoft.Compute/virtualMachines",
212 "name": "[parameters('vmName')]",
213 "location": "[resourceGroup().location]",
215 "[resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]",
216 "[resourceId('Microsoft.Network/networkInterfaces/', variables('nicName'))]"],
218 "hardwareProfile": { "vmSize": "[parameters('vmSize')]"},
220 "computerName": "[parameters('vmName')]",
221 "adminUsername": "[parameters('adminUsername')]",
222 "linuxConfiguration": {
223 "disablePasswordAuthentication": true,
224 "ssh": { "publicKeys": [{
225 "path": "[variables('sshKeyPath')]",
226 "keyData": "[parameters('sshKeyData')]"
230 "publisher": "[variables('imagePublisher')]",
231 "offer": "[variables('imageOffer')]",
232 "sku": "[parameters('ubuntuOSVersion')]",
235 "osDisk": { "diskSizeGB": 127, "createOption": "FromImage" },
236 "dataDisks": [ {"diskSizeGB": 127, "lun": 0, "createOption": "Empty" }]},
238 "networkInterfaces": [{ "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]"}]},
239 "diagnosticsProfile": {
240 "bootDiagnostics": { "enabled": true,
241 "storageUri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName')), '2016-01-01').primaryEndpoints.blob)]"
246 "apiVersion": "2017-12-01",
247 "type": "Microsoft.Compute/virtualMachines/extensions",
248 "name": "[concat(parameters('vmName'),'/onap')]",
249 "location": "[resourceGroup().location]",
250 "dependsOn": ["[concat('Microsoft.Compute/virtualMachines/', parameters('vmName'))]"],
252 "publisher": "Microsoft.Azure.Extensions",
253 "type": "CustomScript",
254 "typeHandlerVersion": "2.0",
255 "autoUpgradeMinorVersion": true,
257 "fileUris": [ "[parameters('scriptURL')]" ],
258 "commandToExecute": "[concat('./' , parameters('scriptName'), ' -b ', parameters('onapBranch'), ' -s ', parameters('vmName'), ' -e ', parameters('onapEnvironment'))]"
267 "value": "[reference(variables('publicIPAddressName')).dnsSettings.fqdn]"
271 "value": "[concat('ssh ', parameters('adminUsername'), '@', reference(variables('publicIPAddressName')).dnsSettings.fqdn)]"