refresh line endings

This commit is contained in:
Megan Marsh 2019-05-17 14:58:20 -07:00
parent 07dbf8195e
commit 3e73abc93a
19 changed files with 4468 additions and 4465 deletions

3
.gitattributes vendored
View File

@ -1,4 +1,7 @@
* text=auto * text=auto
*.go text eol=lf *.go text eol=lf
*.sh text eol=lf *.sh text eol=lf
*.json text eol=lf
*.md text eol=lf
*.ps1 text eol=lf
common/test-fixtures/root/* eol=lf common/test-fixtures/root/* eol=lf

View File

@ -1,72 +1,72 @@
{ {
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0", "contentVersion": "1.0.0.0",
"parameters": { "parameters": {
"keyVaultName": { "keyVaultName": {
"type": "string" "type": "string"
}, },
"keyVaultSecretValue": { "keyVaultSecretValue": {
"type": "securestring" "type": "securestring"
}, },
"objectId": { "objectId": {
"type": "string" "type": "string"
}, },
"tenantId": { "tenantId": {
"type": "string" "type": "string"
} }
}, },
"resources": [ "resources": [
{ {
"apiVersion": "[variables('apiVersion')]", "apiVersion": "[variables('apiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('keyVaultName')]", "name": "[parameters('keyVaultName')]",
"properties": { "properties": {
"accessPolicies": [ "accessPolicies": [
{ {
"objectId": "[parameters('objectId')]", "objectId": "[parameters('objectId')]",
"permissions": { "permissions": {
"keys": [ "keys": [
"all" "all"
], ],
"secrets": [ "secrets": [
"all" "all"
] ]
}, },
"tenantId": "[parameters('tenantId')]" "tenantId": "[parameters('tenantId')]"
} }
], ],
"enabledForDeployment": "true", "enabledForDeployment": "true",
"enabledForTemplateDeployment": "true", "enabledForTemplateDeployment": "true",
"sku": { "sku": {
"family": "A", "family": "A",
"name": "standard" "name": "standard"
}, },
"tenantId": "[parameters('tenantId')]" "tenantId": "[parameters('tenantId')]"
}, },
"resources": [ "resources": [
{ {
"apiVersion": "[variables('apiVersion')]", "apiVersion": "[variables('apiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.KeyVault/vaults/', parameters('keyVaultName'))]" "[concat('Microsoft.KeyVault/vaults/', parameters('keyVaultName'))]"
], ],
"name": "[variables('keyVaultSecretName')]", "name": "[variables('keyVaultSecretName')]",
"properties": { "properties": {
"value": "[parameters('keyVaultSecretValue')]" "value": "[parameters('keyVaultSecretValue')]"
}, },
"type": "secrets" "type": "secrets"
} }
], ],
"tags": { "tags": {
"tag01": "value01", "tag01": "value01",
"tag02": "value02", "tag02": "value02",
"tag03": "value03" "tag03": "value03"
}, },
"type": "Microsoft.KeyVault/vaults" "type": "Microsoft.KeyVault/vaults"
} }
], ],
"variables": { "variables": {
"apiVersion": "2015-06-01", "apiVersion": "2015-06-01",
"keyVaultSecretName": "packerKeyVaultSecret", "keyVaultSecretName": "packerKeyVaultSecret",
"location": "[resourceGroup().location]" "location": "[resourceGroup().location]"
} }
} }

View File

@ -1,174 +1,174 @@
{ {
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0", "contentVersion": "1.0.0.0",
"parameters": { "parameters": {
"adminPassword": { "adminPassword": {
"type": "string" "type": "string"
}, },
"adminUsername": { "adminUsername": {
"type": "string" "type": "string"
}, },
"dnsNameForPublicIP": { "dnsNameForPublicIP": {
"type": "string" "type": "string"
}, },
"nicName": { "nicName": {
"type": "string" "type": "string"
}, },
"osDiskName": { "osDiskName": {
"type": "string" "type": "string"
}, },
"publicIPAddressName": { "publicIPAddressName": {
"type": "string" "type": "string"
}, },
"storageAccountBlobEndpoint": { "storageAccountBlobEndpoint": {
"type": "string" "type": "string"
}, },
"subnetName": { "subnetName": {
"type": "string" "type": "string"
}, },
"virtualNetworkName": { "virtualNetworkName": {
"type": "string" "type": "string"
}, },
"vmName": { "vmName": {
"type": "string" "type": "string"
}, },
"vmSize": { "vmSize": {
"type": "string" "type": "string"
} }
}, },
"resources": [ "resources": [
{ {
"apiVersion": "[variables('publicIPAddressApiVersion')]", "apiVersion": "[variables('publicIPAddressApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('publicIPAddressName')]", "name": "[parameters('publicIPAddressName')]",
"properties": { "properties": {
"dnsSettings": { "dnsSettings": {
"domainNameLabel": "[parameters('dnsNameForPublicIP')]" "domainNameLabel": "[parameters('dnsNameForPublicIP')]"
}, },
"publicIPAllocationMethod": "[variables('publicIPAddressType')]" "publicIPAllocationMethod": "[variables('publicIPAddressType')]"
}, },
"type": "Microsoft.Network/publicIPAddresses" "type": "Microsoft.Network/publicIPAddresses"
}, },
{ {
"apiVersion": "[variables('virtualNetworksApiVersion')]", "apiVersion": "[variables('virtualNetworksApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[variables('virtualNetworkName')]", "name": "[variables('virtualNetworkName')]",
"properties": { "properties": {
"addressSpace": { "addressSpace": {
"addressPrefixes": [ "addressPrefixes": [
"[variables('addressPrefix')]" "[variables('addressPrefix')]"
] ]
}, },
"subnets": [ "subnets": [
{ {
"name": "[variables('subnetName')]", "name": "[variables('subnetName')]",
"properties": { "properties": {
"addressPrefix": "[variables('subnetAddressPrefix')]" "addressPrefix": "[variables('subnetAddressPrefix')]"
} }
} }
] ]
}, },
"type": "Microsoft.Network/virtualNetworks" "type": "Microsoft.Network/virtualNetworks"
}, },
{ {
"apiVersion": "[variables('networkInterfacesApiVersion')]", "apiVersion": "[variables('networkInterfacesApiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]", "[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]" "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('nicName')]", "name": "[parameters('nicName')]",
"properties": { "properties": {
"ipConfigurations": [ "ipConfigurations": [
{ {
"name": "ipconfig", "name": "ipconfig",
"properties": { "properties": {
"privateIPAllocationMethod": "Dynamic", "privateIPAllocationMethod": "Dynamic",
"publicIPAddress": { "publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]" "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
}, },
"subnet": { "subnet": {
"id": "[variables('subnetRef')]" "id": "[variables('subnetRef')]"
} }
} }
} }
] ]
}, },
"type": "Microsoft.Network/networkInterfaces" "type": "Microsoft.Network/networkInterfaces"
}, },
{ {
"apiVersion": "[variables('apiVersion')]", "apiVersion": "[variables('apiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]" "[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('vmName')]", "name": "[parameters('vmName')]",
"properties": { "properties": {
"diagnosticsProfile": { "diagnosticsProfile": {
"bootDiagnostics": { "bootDiagnostics": {
"enabled": false "enabled": false
} }
}, },
"hardwareProfile": { "hardwareProfile": {
"vmSize": "[parameters('vmSize')]" "vmSize": "[parameters('vmSize')]"
}, },
"networkProfile": { "networkProfile": {
"networkInterfaces": [ "networkInterfaces": [
{ {
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]" "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
} }
] ]
}, },
"osProfile": { "osProfile": {
"adminPassword": "[parameters('adminPassword')]", "adminPassword": "[parameters('adminPassword')]",
"adminUsername": "[parameters('adminUsername')]", "adminUsername": "[parameters('adminUsername')]",
"computerName": "[parameters('vmName')]", "computerName": "[parameters('vmName')]",
"linuxConfiguration": { "linuxConfiguration": {
"ssh": { "ssh": {
"publicKeys": [ "publicKeys": [
{ {
"keyData": "", "keyData": "",
"path": "[variables('sshKeyPath')]" "path": "[variables('sshKeyPath')]"
} }
] ]
} }
} }
}, },
"storageProfile": { "storageProfile": {
"imageReference": { "imageReference": {
"offer": "ImageOffer", "offer": "ImageOffer",
"publisher": "ImagePublisher", "publisher": "ImagePublisher",
"sku": "ImageSku", "sku": "ImageSku",
"version": "ImageVersion" "version": "ImageVersion"
}, },
"osDisk": { "osDisk": {
"caching": "ReadWrite", "caching": "ReadWrite",
"createOption": "FromImage", "createOption": "FromImage",
"name": "[parameters('osDiskName')]", "name": "[parameters('osDiskName')]",
"vhd": { "vhd": {
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]" "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]"
} }
} }
} }
}, },
"type": "Microsoft.Compute/virtualMachines" "type": "Microsoft.Compute/virtualMachines"
} }
], ],
"variables": { "variables": {
"addressPrefix": "10.0.0.0/16", "addressPrefix": "10.0.0.0/16",
"apiVersion": "2017-03-30", "apiVersion": "2017-03-30",
"location": "[resourceGroup().location]", "location": "[resourceGroup().location]",
"managedDiskApiVersion": "2017-03-30", "managedDiskApiVersion": "2017-03-30",
"networkInterfacesApiVersion": "2017-04-01", "networkInterfacesApiVersion": "2017-04-01",
"publicIPAddressApiVersion": "2017-04-01", "publicIPAddressApiVersion": "2017-04-01",
"publicIPAddressType": "Dynamic", "publicIPAddressType": "Dynamic",
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]", "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
"subnetAddressPrefix": "10.0.0.0/24", "subnetAddressPrefix": "10.0.0.0/24",
"subnetName": "[parameters('subnetName')]", "subnetName": "[parameters('subnetName')]",
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]", "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
"virtualNetworkName": "[parameters('virtualNetworkName')]", "virtualNetworkName": "[parameters('virtualNetworkName')]",
"virtualNetworkResourceGroup": "[resourceGroup().name]", "virtualNetworkResourceGroup": "[resourceGroup().name]",
"virtualNetworksApiVersion": "2017-04-01", "virtualNetworksApiVersion": "2017-04-01",
"vmStorageAccountContainerName": "images", "vmStorageAccountContainerName": "images",
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
} }

View File

@ -1,173 +1,173 @@
{ {
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0", "contentVersion": "1.0.0.0",
"parameters": { "parameters": {
"adminPassword": { "adminPassword": {
"type": "string" "type": "string"
}, },
"adminUsername": { "adminUsername": {
"type": "string" "type": "string"
}, },
"dnsNameForPublicIP": { "dnsNameForPublicIP": {
"type": "string" "type": "string"
}, },
"nicName": { "nicName": {
"type": "string" "type": "string"
}, },
"osDiskName": { "osDiskName": {
"type": "string" "type": "string"
}, },
"publicIPAddressName": { "publicIPAddressName": {
"type": "string" "type": "string"
}, },
"storageAccountBlobEndpoint": { "storageAccountBlobEndpoint": {
"type": "string" "type": "string"
}, },
"subnetName": { "subnetName": {
"type": "string" "type": "string"
}, },
"virtualNetworkName": { "virtualNetworkName": {
"type": "string" "type": "string"
}, },
"vmName": { "vmName": {
"type": "string" "type": "string"
}, },
"vmSize": { "vmSize": {
"type": "string" "type": "string"
} }
}, },
"resources": [ "resources": [
{ {
"apiVersion": "[variables('publicIPAddressApiVersion')]", "apiVersion": "[variables('publicIPAddressApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('publicIPAddressName')]", "name": "[parameters('publicIPAddressName')]",
"properties": { "properties": {
"dnsSettings": { "dnsSettings": {
"domainNameLabel": "[parameters('dnsNameForPublicIP')]" "domainNameLabel": "[parameters('dnsNameForPublicIP')]"
}, },
"publicIPAllocationMethod": "[variables('publicIPAddressType')]" "publicIPAllocationMethod": "[variables('publicIPAddressType')]"
}, },
"type": "Microsoft.Network/publicIPAddresses" "type": "Microsoft.Network/publicIPAddresses"
}, },
{ {
"apiVersion": "[variables('virtualNetworksApiVersion')]", "apiVersion": "[variables('virtualNetworksApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[variables('virtualNetworkName')]", "name": "[variables('virtualNetworkName')]",
"properties": { "properties": {
"addressSpace": { "addressSpace": {
"addressPrefixes": [ "addressPrefixes": [
"[variables('addressPrefix')]" "[variables('addressPrefix')]"
] ]
}, },
"subnets": [ "subnets": [
{ {
"name": "[variables('subnetName')]", "name": "[variables('subnetName')]",
"properties": { "properties": {
"addressPrefix": "[variables('subnetAddressPrefix')]" "addressPrefix": "[variables('subnetAddressPrefix')]"
} }
} }
] ]
}, },
"type": "Microsoft.Network/virtualNetworks" "type": "Microsoft.Network/virtualNetworks"
}, },
{ {
"apiVersion": "[variables('networkInterfacesApiVersion')]", "apiVersion": "[variables('networkInterfacesApiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]", "[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]" "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('nicName')]", "name": "[parameters('nicName')]",
"properties": { "properties": {
"ipConfigurations": [ "ipConfigurations": [
{ {
"name": "ipconfig", "name": "ipconfig",
"properties": { "properties": {
"privateIPAllocationMethod": "Dynamic", "privateIPAllocationMethod": "Dynamic",
"publicIPAddress": { "publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]" "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
}, },
"subnet": { "subnet": {
"id": "[variables('subnetRef')]" "id": "[variables('subnetRef')]"
} }
} }
} }
] ]
}, },
"type": "Microsoft.Network/networkInterfaces" "type": "Microsoft.Network/networkInterfaces"
}, },
{ {
"apiVersion": "[variables('apiVersion')]", "apiVersion": "[variables('apiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]" "[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('vmName')]", "name": "[parameters('vmName')]",
"properties": { "properties": {
"diagnosticsProfile": { "diagnosticsProfile": {
"bootDiagnostics": { "bootDiagnostics": {
"enabled": false "enabled": false
} }
}, },
"hardwareProfile": { "hardwareProfile": {
"vmSize": "[parameters('vmSize')]" "vmSize": "[parameters('vmSize')]"
}, },
"networkProfile": { "networkProfile": {
"networkInterfaces": [ "networkInterfaces": [
{ {
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]" "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
} }
] ]
}, },
"osProfile": { "osProfile": {
"adminPassword": "[parameters('adminPassword')]", "adminPassword": "[parameters('adminPassword')]",
"adminUsername": "[parameters('adminUsername')]", "adminUsername": "[parameters('adminUsername')]",
"computerName": "[parameters('vmName')]", "computerName": "[parameters('vmName')]",
"linuxConfiguration": { "linuxConfiguration": {
"ssh": { "ssh": {
"publicKeys": [ "publicKeys": [
{ {
"keyData": "", "keyData": "",
"path": "[variables('sshKeyPath')]" "path": "[variables('sshKeyPath')]"
} }
] ]
} }
} }
}, },
"storageProfile": { "storageProfile": {
"osDisk": { "osDisk": {
"caching": "ReadWrite", "caching": "ReadWrite",
"createOption": "FromImage", "createOption": "FromImage",
"image": { "image": {
"uri": "https://localhost/custom.vhd" "uri": "https://localhost/custom.vhd"
}, },
"name": "[parameters('osDiskName')]", "name": "[parameters('osDiskName')]",
"osType": "Linux", "osType": "Linux",
"vhd": { "vhd": {
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]" "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]"
} }
} }
} }
}, },
"type": "Microsoft.Compute/virtualMachines" "type": "Microsoft.Compute/virtualMachines"
} }
], ],
"variables": { "variables": {
"addressPrefix": "10.0.0.0/16", "addressPrefix": "10.0.0.0/16",
"apiVersion": "2017-03-30", "apiVersion": "2017-03-30",
"location": "[resourceGroup().location]", "location": "[resourceGroup().location]",
"managedDiskApiVersion": "2017-03-30", "managedDiskApiVersion": "2017-03-30",
"networkInterfacesApiVersion": "2017-04-01", "networkInterfacesApiVersion": "2017-04-01",
"publicIPAddressApiVersion": "2017-04-01", "publicIPAddressApiVersion": "2017-04-01",
"publicIPAddressType": "Dynamic", "publicIPAddressType": "Dynamic",
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]", "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
"subnetAddressPrefix": "10.0.0.0/24", "subnetAddressPrefix": "10.0.0.0/24",
"subnetName": "[parameters('subnetName')]", "subnetName": "[parameters('subnetName')]",
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]", "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
"virtualNetworkName": "[parameters('virtualNetworkName')]", "virtualNetworkName": "[parameters('virtualNetworkName')]",
"virtualNetworkResourceGroup": "[resourceGroup().name]", "virtualNetworkResourceGroup": "[resourceGroup().name]",
"virtualNetworksApiVersion": "2017-04-01", "virtualNetworksApiVersion": "2017-04-01",
"vmStorageAccountContainerName": "images", "vmStorageAccountContainerName": "images",
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
} }
} }

View File

@ -1,134 +1,134 @@
{ {
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0", "contentVersion": "1.0.0.0",
"parameters": { "parameters": {
"adminPassword": { "adminPassword": {
"type": "string" "type": "string"
}, },
"adminUsername": { "adminUsername": {
"type": "string" "type": "string"
}, },
"dnsNameForPublicIP": { "dnsNameForPublicIP": {
"type": "string" "type": "string"
}, },
"nicName": { "nicName": {
"type": "string" "type": "string"
}, },
"osDiskName": { "osDiskName": {
"type": "string" "type": "string"
}, },
"publicIPAddressName": { "publicIPAddressName": {
"type": "string" "type": "string"
}, },
"storageAccountBlobEndpoint": { "storageAccountBlobEndpoint": {
"type": "string" "type": "string"
}, },
"subnetName": { "subnetName": {
"type": "string" "type": "string"
}, },
"virtualNetworkName": { "virtualNetworkName": {
"type": "string" "type": "string"
}, },
"vmName": { "vmName": {
"type": "string" "type": "string"
}, },
"vmSize": { "vmSize": {
"type": "string" "type": "string"
} }
}, },
"resources": [ "resources": [
{ {
"apiVersion": "[variables('networkInterfacesApiVersion')]", "apiVersion": "[variables('networkInterfacesApiVersion')]",
"dependsOn": [], "dependsOn": [],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('nicName')]", "name": "[parameters('nicName')]",
"properties": { "properties": {
"ipConfigurations": [ "ipConfigurations": [
{ {
"name": "ipconfig", "name": "ipconfig",
"properties": { "properties": {
"privateIPAllocationMethod": "Dynamic", "privateIPAllocationMethod": "Dynamic",
"subnet": { "subnet": {
"id": "[variables('subnetRef')]" "id": "[variables('subnetRef')]"
} }
} }
} }
] ]
}, },
"type": "Microsoft.Network/networkInterfaces" "type": "Microsoft.Network/networkInterfaces"
}, },
{ {
"apiVersion": "[variables('apiVersion')]", "apiVersion": "[variables('apiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]" "[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('vmName')]", "name": "[parameters('vmName')]",
"properties": { "properties": {
"diagnosticsProfile": { "diagnosticsProfile": {
"bootDiagnostics": { "bootDiagnostics": {
"enabled": false "enabled": false
} }
}, },
"hardwareProfile": { "hardwareProfile": {
"vmSize": "[parameters('vmSize')]" "vmSize": "[parameters('vmSize')]"
}, },
"networkProfile": { "networkProfile": {
"networkInterfaces": [ "networkInterfaces": [
{ {
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]" "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
} }
] ]
}, },
"osProfile": { "osProfile": {
"adminPassword": "[parameters('adminPassword')]", "adminPassword": "[parameters('adminPassword')]",
"adminUsername": "[parameters('adminUsername')]", "adminUsername": "[parameters('adminUsername')]",
"computerName": "[parameters('vmName')]", "computerName": "[parameters('vmName')]",
"linuxConfiguration": { "linuxConfiguration": {
"ssh": { "ssh": {
"publicKeys": [ "publicKeys": [
{ {
"keyData": "", "keyData": "",
"path": "[variables('sshKeyPath')]" "path": "[variables('sshKeyPath')]"
} }
] ]
} }
} }
}, },
"storageProfile": { "storageProfile": {
"osDisk": { "osDisk": {
"caching": "ReadWrite", "caching": "ReadWrite",
"createOption": "FromImage", "createOption": "FromImage",
"image": { "image": {
"uri": "https://localhost/custom.vhd" "uri": "https://localhost/custom.vhd"
}, },
"name": "[parameters('osDiskName')]", "name": "[parameters('osDiskName')]",
"osType": "Linux", "osType": "Linux",
"vhd": { "vhd": {
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]" "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]"
} }
} }
} }
}, },
"type": "Microsoft.Compute/virtualMachines" "type": "Microsoft.Compute/virtualMachines"
} }
], ],
"variables": { "variables": {
"addressPrefix": "10.0.0.0/16", "addressPrefix": "10.0.0.0/16",
"apiVersion": "2017-03-30", "apiVersion": "2017-03-30",
"location": "[resourceGroup().location]", "location": "[resourceGroup().location]",
"managedDiskApiVersion": "2017-03-30", "managedDiskApiVersion": "2017-03-30",
"networkInterfacesApiVersion": "2017-04-01", "networkInterfacesApiVersion": "2017-04-01",
"publicIPAddressApiVersion": "2017-04-01", "publicIPAddressApiVersion": "2017-04-01",
"publicIPAddressType": "Dynamic", "publicIPAddressType": "Dynamic",
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]", "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
"subnetAddressPrefix": "10.0.0.0/24", "subnetAddressPrefix": "10.0.0.0/24",
"subnetName": "virtualNetworkSubnetName", "subnetName": "virtualNetworkSubnetName",
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]", "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
"virtualNetworkName": "virtualNetworkName", "virtualNetworkName": "virtualNetworkName",
"virtualNetworkResourceGroup": "virtualNetworkResourceGroupName", "virtualNetworkResourceGroup": "virtualNetworkResourceGroupName",
"virtualNetworksApiVersion": "2017-04-01", "virtualNetworksApiVersion": "2017-04-01",
"vmStorageAccountContainerName": "images", "vmStorageAccountContainerName": "images",
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
} }
} }

View File

@ -1,193 +1,193 @@
{ {
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0", "contentVersion": "1.0.0.0",
"parameters": { "parameters": {
"adminPassword": { "adminPassword": {
"type": "string" "type": "string"
}, },
"adminUsername": { "adminUsername": {
"type": "string" "type": "string"
}, },
"dnsNameForPublicIP": { "dnsNameForPublicIP": {
"type": "string" "type": "string"
}, },
"nicName": { "nicName": {
"type": "string" "type": "string"
}, },
"osDiskName": { "osDiskName": {
"type": "string" "type": "string"
}, },
"publicIPAddressName": { "publicIPAddressName": {
"type": "string" "type": "string"
}, },
"storageAccountBlobEndpoint": { "storageAccountBlobEndpoint": {
"type": "string" "type": "string"
}, },
"subnetName": { "subnetName": {
"type": "string" "type": "string"
}, },
"virtualNetworkName": { "virtualNetworkName": {
"type": "string" "type": "string"
}, },
"vmName": { "vmName": {
"type": "string" "type": "string"
}, },
"vmSize": { "vmSize": {
"type": "string" "type": "string"
} }
}, },
"resources": [ "resources": [
{ {
"apiVersion": "[variables('publicIPAddressApiVersion')]", "apiVersion": "[variables('publicIPAddressApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('publicIPAddressName')]", "name": "[parameters('publicIPAddressName')]",
"properties": { "properties": {
"dnsSettings": { "dnsSettings": {
"domainNameLabel": "[parameters('dnsNameForPublicIP')]" "domainNameLabel": "[parameters('dnsNameForPublicIP')]"
}, },
"publicIPAllocationMethod": "[variables('publicIPAddressType')]" "publicIPAllocationMethod": "[variables('publicIPAddressType')]"
}, },
"tags": { "tags": {
"tag01": "value01", "tag01": "value01",
"tag02": "value02", "tag02": "value02",
"tag03": "value03" "tag03": "value03"
}, },
"type": "Microsoft.Network/publicIPAddresses" "type": "Microsoft.Network/publicIPAddresses"
}, },
{ {
"apiVersion": "[variables('virtualNetworksApiVersion')]", "apiVersion": "[variables('virtualNetworksApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[variables('virtualNetworkName')]", "name": "[variables('virtualNetworkName')]",
"properties": { "properties": {
"addressSpace": { "addressSpace": {
"addressPrefixes": [ "addressPrefixes": [
"[variables('addressPrefix')]" "[variables('addressPrefix')]"
] ]
}, },
"subnets": [ "subnets": [
{ {
"name": "[variables('subnetName')]", "name": "[variables('subnetName')]",
"properties": { "properties": {
"addressPrefix": "[variables('subnetAddressPrefix')]" "addressPrefix": "[variables('subnetAddressPrefix')]"
} }
} }
] ]
}, },
"tags": { "tags": {
"tag01": "value01", "tag01": "value01",
"tag02": "value02", "tag02": "value02",
"tag03": "value03" "tag03": "value03"
}, },
"type": "Microsoft.Network/virtualNetworks" "type": "Microsoft.Network/virtualNetworks"
}, },
{ {
"apiVersion": "[variables('networkInterfacesApiVersion')]", "apiVersion": "[variables('networkInterfacesApiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]", "[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]" "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('nicName')]", "name": "[parameters('nicName')]",
"properties": { "properties": {
"ipConfigurations": [ "ipConfigurations": [
{ {
"name": "ipconfig", "name": "ipconfig",
"properties": { "properties": {
"privateIPAllocationMethod": "Dynamic", "privateIPAllocationMethod": "Dynamic",
"publicIPAddress": { "publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]" "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
}, },
"subnet": { "subnet": {
"id": "[variables('subnetRef')]" "id": "[variables('subnetRef')]"
} }
} }
} }
] ]
}, },
"tags": { "tags": {
"tag01": "value01", "tag01": "value01",
"tag02": "value02", "tag02": "value02",
"tag03": "value03" "tag03": "value03"
}, },
"type": "Microsoft.Network/networkInterfaces" "type": "Microsoft.Network/networkInterfaces"
}, },
{ {
"apiVersion": "[variables('apiVersion')]", "apiVersion": "[variables('apiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]" "[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('vmName')]", "name": "[parameters('vmName')]",
"properties": { "properties": {
"diagnosticsProfile": { "diagnosticsProfile": {
"bootDiagnostics": { "bootDiagnostics": {
"enabled": false "enabled": false
} }
}, },
"hardwareProfile": { "hardwareProfile": {
"vmSize": "[parameters('vmSize')]" "vmSize": "[parameters('vmSize')]"
}, },
"networkProfile": { "networkProfile": {
"networkInterfaces": [ "networkInterfaces": [
{ {
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]" "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
} }
] ]
}, },
"osProfile": { "osProfile": {
"adminPassword": "[parameters('adminPassword')]", "adminPassword": "[parameters('adminPassword')]",
"adminUsername": "[parameters('adminUsername')]", "adminUsername": "[parameters('adminUsername')]",
"computerName": "[parameters('vmName')]", "computerName": "[parameters('vmName')]",
"linuxConfiguration": { "linuxConfiguration": {
"ssh": { "ssh": {
"publicKeys": [ "publicKeys": [
{ {
"keyData": "", "keyData": "",
"path": "[variables('sshKeyPath')]" "path": "[variables('sshKeyPath')]"
} }
] ]
} }
} }
}, },
"storageProfile": { "storageProfile": {
"osDisk": { "osDisk": {
"caching": "ReadWrite", "caching": "ReadWrite",
"createOption": "FromImage", "createOption": "FromImage",
"image": { "image": {
"uri": "https://localhost/custom.vhd" "uri": "https://localhost/custom.vhd"
}, },
"name": "[parameters('osDiskName')]", "name": "[parameters('osDiskName')]",
"osType": "Linux", "osType": "Linux",
"vhd": { "vhd": {
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]" "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]"
} }
} }
} }
}, },
"tags": { "tags": {
"tag01": "value01", "tag01": "value01",
"tag02": "value02", "tag02": "value02",
"tag03": "value03" "tag03": "value03"
}, },
"type": "Microsoft.Compute/virtualMachines" "type": "Microsoft.Compute/virtualMachines"
} }
], ],
"variables": { "variables": {
"addressPrefix": "10.0.0.0/16", "addressPrefix": "10.0.0.0/16",
"apiVersion": "2017-03-30", "apiVersion": "2017-03-30",
"location": "[resourceGroup().location]", "location": "[resourceGroup().location]",
"managedDiskApiVersion": "2017-03-30", "managedDiskApiVersion": "2017-03-30",
"networkInterfacesApiVersion": "2017-04-01", "networkInterfacesApiVersion": "2017-04-01",
"publicIPAddressApiVersion": "2017-04-01", "publicIPAddressApiVersion": "2017-04-01",
"publicIPAddressType": "Dynamic", "publicIPAddressType": "Dynamic",
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]", "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
"subnetAddressPrefix": "10.0.0.0/24", "subnetAddressPrefix": "10.0.0.0/24",
"subnetName": "[parameters('subnetName')]", "subnetName": "[parameters('subnetName')]",
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]", "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
"virtualNetworkName": "[parameters('virtualNetworkName')]", "virtualNetworkName": "[parameters('virtualNetworkName')]",
"virtualNetworkResourceGroup": "[resourceGroup().name]", "virtualNetworkResourceGroup": "[resourceGroup().name]",
"virtualNetworksApiVersion": "2017-04-01", "virtualNetworksApiVersion": "2017-04-01",
"vmStorageAccountContainerName": "images", "vmStorageAccountContainerName": "images",
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
} }
} }

View File

@ -1,174 +1,174 @@
{ {
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0", "contentVersion": "1.0.0.0",
"parameters": { "parameters": {
"adminPassword": { "adminPassword": {
"type": "string" "type": "string"
}, },
"adminUsername": { "adminUsername": {
"type": "string" "type": "string"
}, },
"dnsNameForPublicIP": { "dnsNameForPublicIP": {
"type": "string" "type": "string"
}, },
"nicName": { "nicName": {
"type": "string" "type": "string"
}, },
"osDiskName": { "osDiskName": {
"type": "string" "type": "string"
}, },
"publicIPAddressName": { "publicIPAddressName": {
"type": "string" "type": "string"
}, },
"storageAccountBlobEndpoint": { "storageAccountBlobEndpoint": {
"type": "string" "type": "string"
}, },
"subnetName": { "subnetName": {
"type": "string" "type": "string"
}, },
"virtualNetworkName": { "virtualNetworkName": {
"type": "string" "type": "string"
}, },
"vmName": { "vmName": {
"type": "string" "type": "string"
}, },
"vmSize": { "vmSize": {
"type": "string" "type": "string"
} }
}, },
"resources": [ "resources": [
{ {
"apiVersion": "[variables('publicIPAddressApiVersion')]", "apiVersion": "[variables('publicIPAddressApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('publicIPAddressName')]", "name": "[parameters('publicIPAddressName')]",
"properties": { "properties": {
"dnsSettings": { "dnsSettings": {
"domainNameLabel": "[parameters('dnsNameForPublicIP')]" "domainNameLabel": "[parameters('dnsNameForPublicIP')]"
}, },
"publicIPAllocationMethod": "[variables('publicIPAddressType')]" "publicIPAllocationMethod": "[variables('publicIPAddressType')]"
}, },
"type": "Microsoft.Network/publicIPAddresses" "type": "Microsoft.Network/publicIPAddresses"
}, },
{ {
"apiVersion": "[variables('virtualNetworksApiVersion')]", "apiVersion": "[variables('virtualNetworksApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[variables('virtualNetworkName')]", "name": "[variables('virtualNetworkName')]",
"properties": { "properties": {
"addressSpace": { "addressSpace": {
"addressPrefixes": [ "addressPrefixes": [
"[variables('addressPrefix')]" "[variables('addressPrefix')]"
] ]
}, },
"subnets": [ "subnets": [
{ {
"name": "[variables('subnetName')]", "name": "[variables('subnetName')]",
"properties": { "properties": {
"addressPrefix": "[variables('subnetAddressPrefix')]" "addressPrefix": "[variables('subnetAddressPrefix')]"
} }
} }
] ]
}, },
"type": "Microsoft.Network/virtualNetworks" "type": "Microsoft.Network/virtualNetworks"
}, },
{ {
"apiVersion": "[variables('networkInterfacesApiVersion')]", "apiVersion": "[variables('networkInterfacesApiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]", "[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]" "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('nicName')]", "name": "[parameters('nicName')]",
"properties": { "properties": {
"ipConfigurations": [ "ipConfigurations": [
{ {
"name": "ipconfig", "name": "ipconfig",
"properties": { "properties": {
"privateIPAllocationMethod": "Dynamic", "privateIPAllocationMethod": "Dynamic",
"publicIPAddress": { "publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]" "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
}, },
"subnet": { "subnet": {
"id": "[variables('subnetRef')]" "id": "[variables('subnetRef')]"
} }
} }
} }
] ]
}, },
"type": "Microsoft.Network/networkInterfaces" "type": "Microsoft.Network/networkInterfaces"
}, },
{ {
"apiVersion": "[variables('apiVersion')]", "apiVersion": "[variables('apiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]" "[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('vmName')]", "name": "[parameters('vmName')]",
"properties": { "properties": {
"diagnosticsProfile": { "diagnosticsProfile": {
"bootDiagnostics": { "bootDiagnostics": {
"enabled": false "enabled": false
} }
}, },
"hardwareProfile": { "hardwareProfile": {
"vmSize": "[parameters('vmSize')]" "vmSize": "[parameters('vmSize')]"
}, },
"networkProfile": { "networkProfile": {
"networkInterfaces": [ "networkInterfaces": [
{ {
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]" "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
} }
] ]
}, },
"osProfile": { "osProfile": {
"adminPassword": "[parameters('adminPassword')]", "adminPassword": "[parameters('adminPassword')]",
"adminUsername": "[parameters('adminUsername')]", "adminUsername": "[parameters('adminUsername')]",
"computerName": "[parameters('vmName')]", "computerName": "[parameters('vmName')]",
"customData": "I2Nsb3VkLWNvbmZpZwpncm93cGFydDoKICBtb2RlOiBvZmYK", "customData": "I2Nsb3VkLWNvbmZpZwpncm93cGFydDoKICBtb2RlOiBvZmYK",
"linuxConfiguration": { "linuxConfiguration": {
"ssh": { "ssh": {
"publicKeys": [ "publicKeys": [
{ {
"keyData": "", "keyData": "",
"path": "[variables('sshKeyPath')]" "path": "[variables('sshKeyPath')]"
} }
] ]
} }
} }
}, },
"storageProfile": { "storageProfile": {
"osDisk": { "osDisk": {
"caching": "ReadWrite", "caching": "ReadWrite",
"createOption": "FromImage", "createOption": "FromImage",
"image": { "image": {
"uri": "https://localhost/custom.vhd" "uri": "https://localhost/custom.vhd"
}, },
"name": "[parameters('osDiskName')]", "name": "[parameters('osDiskName')]",
"osType": "Linux", "osType": "Linux",
"vhd": { "vhd": {
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]" "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]"
} }
} }
} }
}, },
"type": "Microsoft.Compute/virtualMachines" "type": "Microsoft.Compute/virtualMachines"
} }
], ],
"variables": { "variables": {
"addressPrefix": "10.0.0.0/16", "addressPrefix": "10.0.0.0/16",
"apiVersion": "2017-03-30", "apiVersion": "2017-03-30",
"location": "[resourceGroup().location]", "location": "[resourceGroup().location]",
"managedDiskApiVersion": "2017-03-30", "managedDiskApiVersion": "2017-03-30",
"networkInterfacesApiVersion": "2017-04-01", "networkInterfacesApiVersion": "2017-04-01",
"publicIPAddressApiVersion": "2017-04-01", "publicIPAddressApiVersion": "2017-04-01",
"publicIPAddressType": "Dynamic", "publicIPAddressType": "Dynamic",
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]", "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
"subnetAddressPrefix": "10.0.0.0/24", "subnetAddressPrefix": "10.0.0.0/24",
"subnetName": "[parameters('subnetName')]", "subnetName": "[parameters('subnetName')]",
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]", "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
"virtualNetworkName": "[parameters('virtualNetworkName')]", "virtualNetworkName": "[parameters('virtualNetworkName')]",
"virtualNetworkResourceGroup": "[resourceGroup().name]", "virtualNetworkResourceGroup": "[resourceGroup().name]",
"virtualNetworksApiVersion": "2017-04-01", "virtualNetworksApiVersion": "2017-04-01",
"vmStorageAccountContainerName": "images", "vmStorageAccountContainerName": "images",
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
} }
} }

View File

@ -1,173 +1,173 @@
{ {
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0", "contentVersion": "1.0.0.0",
"parameters": { "parameters": {
"adminPassword": { "adminPassword": {
"type": "string" "type": "string"
}, },
"adminUsername": { "adminUsername": {
"type": "string" "type": "string"
}, },
"dnsNameForPublicIP": { "dnsNameForPublicIP": {
"type": "string" "type": "string"
}, },
"nicName": { "nicName": {
"type": "string" "type": "string"
}, },
"osDiskName": { "osDiskName": {
"type": "string" "type": "string"
}, },
"publicIPAddressName": { "publicIPAddressName": {
"type": "string" "type": "string"
}, },
"storageAccountBlobEndpoint": { "storageAccountBlobEndpoint": {
"type": "string" "type": "string"
}, },
"subnetName": { "subnetName": {
"type": "string" "type": "string"
}, },
"virtualNetworkName": { "virtualNetworkName": {
"type": "string" "type": "string"
}, },
"vmName": { "vmName": {
"type": "string" "type": "string"
}, },
"vmSize": { "vmSize": {
"type": "string" "type": "string"
} }
}, },
"resources": [ "resources": [
{ {
"apiVersion": "[variables('publicIPAddressApiVersion')]", "apiVersion": "[variables('publicIPAddressApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('publicIPAddressName')]", "name": "[parameters('publicIPAddressName')]",
"properties": { "properties": {
"dnsSettings": { "dnsSettings": {
"domainNameLabel": "[parameters('dnsNameForPublicIP')]" "domainNameLabel": "[parameters('dnsNameForPublicIP')]"
}, },
"publicIPAllocationMethod": "[variables('publicIPAddressType')]" "publicIPAllocationMethod": "[variables('publicIPAddressType')]"
}, },
"type": "Microsoft.Network/publicIPAddresses" "type": "Microsoft.Network/publicIPAddresses"
}, },
{ {
"apiVersion": "[variables('virtualNetworksApiVersion')]", "apiVersion": "[variables('virtualNetworksApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[variables('virtualNetworkName')]", "name": "[variables('virtualNetworkName')]",
"properties": { "properties": {
"addressSpace": { "addressSpace": {
"addressPrefixes": [ "addressPrefixes": [
"[variables('addressPrefix')]" "[variables('addressPrefix')]"
] ]
}, },
"subnets": [ "subnets": [
{ {
"name": "[variables('subnetName')]", "name": "[variables('subnetName')]",
"properties": { "properties": {
"addressPrefix": "[variables('subnetAddressPrefix')]" "addressPrefix": "[variables('subnetAddressPrefix')]"
} }
} }
] ]
}, },
"type": "Microsoft.Network/virtualNetworks" "type": "Microsoft.Network/virtualNetworks"
}, },
{ {
"apiVersion": "[variables('networkInterfacesApiVersion')]", "apiVersion": "[variables('networkInterfacesApiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]", "[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]" "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('nicName')]", "name": "[parameters('nicName')]",
"properties": { "properties": {
"ipConfigurations": [ "ipConfigurations": [
{ {
"name": "ipconfig", "name": "ipconfig",
"properties": { "properties": {
"privateIPAllocationMethod": "Dynamic", "privateIPAllocationMethod": "Dynamic",
"publicIPAddress": { "publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]" "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
}, },
"subnet": { "subnet": {
"id": "[variables('subnetRef')]" "id": "[variables('subnetRef')]"
} }
} }
} }
] ]
}, },
"type": "Microsoft.Network/networkInterfaces" "type": "Microsoft.Network/networkInterfaces"
}, },
{ {
"apiVersion": "[variables('apiVersion')]", "apiVersion": "[variables('apiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]" "[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('vmName')]", "name": "[parameters('vmName')]",
"properties": { "properties": {
"diagnosticsProfile": { "diagnosticsProfile": {
"bootDiagnostics": { "bootDiagnostics": {
"enabled": false "enabled": false
} }
}, },
"hardwareProfile": { "hardwareProfile": {
"vmSize": "[parameters('vmSize')]" "vmSize": "[parameters('vmSize')]"
}, },
"networkProfile": { "networkProfile": {
"networkInterfaces": [ "networkInterfaces": [
{ {
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]" "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
} }
] ]
}, },
"osProfile": { "osProfile": {
"adminPassword": "[parameters('adminPassword')]", "adminPassword": "[parameters('adminPassword')]",
"adminUsername": "[parameters('adminUsername')]", "adminUsername": "[parameters('adminUsername')]",
"computerName": "[parameters('vmName')]", "computerName": "[parameters('vmName')]",
"linuxConfiguration": { "linuxConfiguration": {
"ssh": { "ssh": {
"publicKeys": [ "publicKeys": [
{ {
"keyData": "", "keyData": "",
"path": "[variables('sshKeyPath')]" "path": "[variables('sshKeyPath')]"
} }
] ]
} }
} }
}, },
"storageProfile": { "storageProfile": {
"imageReference": { "imageReference": {
"id": "" "id": ""
}, },
"osDisk": { "osDisk": {
"caching": "ReadWrite", "caching": "ReadWrite",
"createOption": "FromImage", "createOption": "FromImage",
"managedDisk": { "managedDisk": {
"storageAccountType": "Standard_LRS" "storageAccountType": "Standard_LRS"
}, },
"name": "[parameters('osDiskName')]", "name": "[parameters('osDiskName')]",
"osType": "Linux" "osType": "Linux"
} }
} }
}, },
"type": "Microsoft.Compute/virtualMachines" "type": "Microsoft.Compute/virtualMachines"
} }
], ],
"variables": { "variables": {
"addressPrefix": "10.0.0.0/16", "addressPrefix": "10.0.0.0/16",
"apiVersion": "2017-03-30", "apiVersion": "2017-03-30",
"location": "[resourceGroup().location]", "location": "[resourceGroup().location]",
"managedDiskApiVersion": "2017-03-30", "managedDiskApiVersion": "2017-03-30",
"networkInterfacesApiVersion": "2017-04-01", "networkInterfacesApiVersion": "2017-04-01",
"publicIPAddressApiVersion": "2017-04-01", "publicIPAddressApiVersion": "2017-04-01",
"publicIPAddressType": "Dynamic", "publicIPAddressType": "Dynamic",
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]", "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
"subnetAddressPrefix": "10.0.0.0/24", "subnetAddressPrefix": "10.0.0.0/24",
"subnetName": "[parameters('subnetName')]", "subnetName": "[parameters('subnetName')]",
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]", "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
"virtualNetworkName": "[parameters('virtualNetworkName')]", "virtualNetworkName": "[parameters('virtualNetworkName')]",
"virtualNetworkResourceGroup": "[resourceGroup().name]", "virtualNetworkResourceGroup": "[resourceGroup().name]",
"virtualNetworksApiVersion": "2017-04-01", "virtualNetworksApiVersion": "2017-04-01",
"vmStorageAccountContainerName": "images", "vmStorageAccountContainerName": "images",
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
} }
} }

View File

@ -1,176 +1,176 @@
{ {
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0", "contentVersion": "1.0.0.0",
"parameters": { "parameters": {
"adminPassword": { "adminPassword": {
"type": "string" "type": "string"
}, },
"adminUsername": { "adminUsername": {
"type": "string" "type": "string"
}, },
"dnsNameForPublicIP": { "dnsNameForPublicIP": {
"type": "string" "type": "string"
}, },
"nicName": { "nicName": {
"type": "string" "type": "string"
}, },
"osDiskName": { "osDiskName": {
"type": "string" "type": "string"
}, },
"publicIPAddressName": { "publicIPAddressName": {
"type": "string" "type": "string"
}, },
"storageAccountBlobEndpoint": { "storageAccountBlobEndpoint": {
"type": "string" "type": "string"
}, },
"subnetName": { "subnetName": {
"type": "string" "type": "string"
}, },
"virtualNetworkName": { "virtualNetworkName": {
"type": "string" "type": "string"
}, },
"vmName": { "vmName": {
"type": "string" "type": "string"
}, },
"vmSize": { "vmSize": {
"type": "string" "type": "string"
} }
}, },
"resources": [ "resources": [
{ {
"apiVersion": "[variables('publicIPAddressApiVersion')]", "apiVersion": "[variables('publicIPAddressApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('publicIPAddressName')]", "name": "[parameters('publicIPAddressName')]",
"properties": { "properties": {
"dnsSettings": { "dnsSettings": {
"domainNameLabel": "[parameters('dnsNameForPublicIP')]" "domainNameLabel": "[parameters('dnsNameForPublicIP')]"
}, },
"publicIPAllocationMethod": "[variables('publicIPAddressType')]" "publicIPAllocationMethod": "[variables('publicIPAddressType')]"
}, },
"type": "Microsoft.Network/publicIPAddresses" "type": "Microsoft.Network/publicIPAddresses"
}, },
{ {
"apiVersion": "[variables('virtualNetworksApiVersion')]", "apiVersion": "[variables('virtualNetworksApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[variables('virtualNetworkName')]", "name": "[variables('virtualNetworkName')]",
"properties": { "properties": {
"addressSpace": { "addressSpace": {
"addressPrefixes": [ "addressPrefixes": [
"[variables('addressPrefix')]" "[variables('addressPrefix')]"
] ]
}, },
"subnets": [ "subnets": [
{ {
"name": "[variables('subnetName')]", "name": "[variables('subnetName')]",
"properties": { "properties": {
"addressPrefix": "[variables('subnetAddressPrefix')]" "addressPrefix": "[variables('subnetAddressPrefix')]"
} }
} }
] ]
}, },
"type": "Microsoft.Network/virtualNetworks" "type": "Microsoft.Network/virtualNetworks"
}, },
{ {
"apiVersion": "[variables('networkInterfacesApiVersion')]", "apiVersion": "[variables('networkInterfacesApiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]", "[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]" "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('nicName')]", "name": "[parameters('nicName')]",
"properties": { "properties": {
"ipConfigurations": [ "ipConfigurations": [
{ {
"name": "ipconfig", "name": "ipconfig",
"properties": { "properties": {
"privateIPAllocationMethod": "Dynamic", "privateIPAllocationMethod": "Dynamic",
"publicIPAddress": { "publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]" "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
}, },
"subnet": { "subnet": {
"id": "[variables('subnetRef')]" "id": "[variables('subnetRef')]"
} }
} }
} }
] ]
}, },
"type": "Microsoft.Network/networkInterfaces" "type": "Microsoft.Network/networkInterfaces"
}, },
{ {
"apiVersion": "[variables('apiVersion')]", "apiVersion": "[variables('apiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]" "[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('vmName')]", "name": "[parameters('vmName')]",
"properties": { "properties": {
"diagnosticsProfile": { "diagnosticsProfile": {
"bootDiagnostics": { "bootDiagnostics": {
"enabled": false "enabled": false
} }
}, },
"hardwareProfile": { "hardwareProfile": {
"vmSize": "[parameters('vmSize')]" "vmSize": "[parameters('vmSize')]"
}, },
"networkProfile": { "networkProfile": {
"networkInterfaces": [ "networkInterfaces": [
{ {
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]" "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
} }
] ]
}, },
"osProfile": { "osProfile": {
"adminPassword": "[parameters('adminPassword')]", "adminPassword": "[parameters('adminPassword')]",
"adminUsername": "[parameters('adminUsername')]", "adminUsername": "[parameters('adminUsername')]",
"computerName": "[parameters('vmName')]", "computerName": "[parameters('vmName')]",
"linuxConfiguration": { "linuxConfiguration": {
"ssh": { "ssh": {
"publicKeys": [ "publicKeys": [
{ {
"keyData": "", "keyData": "",
"path": "[variables('sshKeyPath')]" "path": "[variables('sshKeyPath')]"
} }
] ]
} }
} }
}, },
"storageProfile": { "storageProfile": {
"imageReference": { "imageReference": {
"offer": "--image-offer--", "offer": "--image-offer--",
"publisher": "--image-publisher--", "publisher": "--image-publisher--",
"sku": "--image-sku--", "sku": "--image-sku--",
"version": "--version--" "version": "--version--"
}, },
"osDisk": { "osDisk": {
"caching": "ReadWrite", "caching": "ReadWrite",
"createOption": "FromImage", "createOption": "FromImage",
"managedDisk": { "managedDisk": {
"storageAccountType": "Standard_LRS" "storageAccountType": "Standard_LRS"
}, },
"name": "[parameters('osDiskName')]", "name": "[parameters('osDiskName')]",
"osType": "Linux" "osType": "Linux"
} }
} }
}, },
"type": "Microsoft.Compute/virtualMachines" "type": "Microsoft.Compute/virtualMachines"
} }
], ],
"variables": { "variables": {
"addressPrefix": "10.0.0.0/16", "addressPrefix": "10.0.0.0/16",
"apiVersion": "2017-03-30", "apiVersion": "2017-03-30",
"location": "[resourceGroup().location]", "location": "[resourceGroup().location]",
"managedDiskApiVersion": "2017-03-30", "managedDiskApiVersion": "2017-03-30",
"networkInterfacesApiVersion": "2017-04-01", "networkInterfacesApiVersion": "2017-04-01",
"publicIPAddressApiVersion": "2017-04-01", "publicIPAddressApiVersion": "2017-04-01",
"publicIPAddressType": "Dynamic", "publicIPAddressType": "Dynamic",
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]", "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
"subnetAddressPrefix": "10.0.0.0/24", "subnetAddressPrefix": "10.0.0.0/24",
"subnetName": "[parameters('subnetName')]", "subnetName": "[parameters('subnetName')]",
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]", "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
"virtualNetworkName": "[parameters('virtualNetworkName')]", "virtualNetworkName": "[parameters('virtualNetworkName')]",
"virtualNetworkResourceGroup": "[resourceGroup().name]", "virtualNetworkResourceGroup": "[resourceGroup().name]",
"virtualNetworksApiVersion": "2017-04-01", "virtualNetworksApiVersion": "2017-04-01",
"vmStorageAccountContainerName": "images", "vmStorageAccountContainerName": "images",
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
} }
} }

View File

@ -1,175 +1,175 @@
{ {
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0", "contentVersion": "1.0.0.0",
"parameters": { "parameters": {
"adminPassword": { "adminPassword": {
"type": "string" "type": "string"
}, },
"adminUsername": { "adminUsername": {
"type": "string" "type": "string"
}, },
"dnsNameForPublicIP": { "dnsNameForPublicIP": {
"type": "string" "type": "string"
}, },
"nicName": { "nicName": {
"type": "string" "type": "string"
}, },
"osDiskName": { "osDiskName": {
"type": "string" "type": "string"
}, },
"publicIPAddressName": { "publicIPAddressName": {
"type": "string" "type": "string"
}, },
"storageAccountBlobEndpoint": { "storageAccountBlobEndpoint": {
"type": "string" "type": "string"
}, },
"subnetName": { "subnetName": {
"type": "string" "type": "string"
}, },
"virtualNetworkName": { "virtualNetworkName": {
"type": "string" "type": "string"
}, },
"vmName": { "vmName": {
"type": "string" "type": "string"
}, },
"vmSize": { "vmSize": {
"type": "string" "type": "string"
} }
}, },
"resources": [ "resources": [
{ {
"apiVersion": "[variables('publicIPAddressApiVersion')]", "apiVersion": "[variables('publicIPAddressApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('publicIPAddressName')]", "name": "[parameters('publicIPAddressName')]",
"properties": { "properties": {
"dnsSettings": { "dnsSettings": {
"domainNameLabel": "[parameters('dnsNameForPublicIP')]" "domainNameLabel": "[parameters('dnsNameForPublicIP')]"
}, },
"publicIPAllocationMethod": "[variables('publicIPAddressType')]" "publicIPAllocationMethod": "[variables('publicIPAddressType')]"
}, },
"type": "Microsoft.Network/publicIPAddresses" "type": "Microsoft.Network/publicIPAddresses"
}, },
{ {
"apiVersion": "[variables('virtualNetworksApiVersion')]", "apiVersion": "[variables('virtualNetworksApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[variables('virtualNetworkName')]", "name": "[variables('virtualNetworkName')]",
"properties": { "properties": {
"addressSpace": { "addressSpace": {
"addressPrefixes": [ "addressPrefixes": [
"[variables('addressPrefix')]" "[variables('addressPrefix')]"
] ]
}, },
"subnets": [ "subnets": [
{ {
"name": "[variables('subnetName')]", "name": "[variables('subnetName')]",
"properties": { "properties": {
"addressPrefix": "[variables('subnetAddressPrefix')]" "addressPrefix": "[variables('subnetAddressPrefix')]"
} }
} }
] ]
}, },
"type": "Microsoft.Network/virtualNetworks" "type": "Microsoft.Network/virtualNetworks"
}, },
{ {
"apiVersion": "[variables('networkInterfacesApiVersion')]", "apiVersion": "[variables('networkInterfacesApiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]", "[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]" "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('nicName')]", "name": "[parameters('nicName')]",
"properties": { "properties": {
"ipConfigurations": [ "ipConfigurations": [
{ {
"name": "ipconfig", "name": "ipconfig",
"properties": { "properties": {
"privateIPAllocationMethod": "Dynamic", "privateIPAllocationMethod": "Dynamic",
"publicIPAddress": { "publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]" "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
}, },
"subnet": { "subnet": {
"id": "[variables('subnetRef')]" "id": "[variables('subnetRef')]"
} }
} }
} }
] ]
}, },
"type": "Microsoft.Network/networkInterfaces" "type": "Microsoft.Network/networkInterfaces"
}, },
{ {
"apiVersion": "[variables('apiVersion')]", "apiVersion": "[variables('apiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]" "[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('vmName')]", "name": "[parameters('vmName')]",
"properties": { "properties": {
"diagnosticsProfile": { "diagnosticsProfile": {
"bootDiagnostics": { "bootDiagnostics": {
"enabled": false "enabled": false
} }
}, },
"hardwareProfile": { "hardwareProfile": {
"vmSize": "[parameters('vmSize')]" "vmSize": "[parameters('vmSize')]"
}, },
"networkProfile": { "networkProfile": {
"networkInterfaces": [ "networkInterfaces": [
{ {
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]" "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
} }
] ]
}, },
"osProfile": { "osProfile": {
"adminPassword": "[parameters('adminPassword')]", "adminPassword": "[parameters('adminPassword')]",
"adminUsername": "[parameters('adminUsername')]", "adminUsername": "[parameters('adminUsername')]",
"computerName": "[parameters('vmName')]", "computerName": "[parameters('vmName')]",
"linuxConfiguration": { "linuxConfiguration": {
"ssh": { "ssh": {
"publicKeys": [ "publicKeys": [
{ {
"keyData": "--test-ssh-authorized-key--", "keyData": "--test-ssh-authorized-key--",
"path": "[variables('sshKeyPath')]" "path": "[variables('sshKeyPath')]"
} }
] ]
} }
} }
}, },
"storageProfile": { "storageProfile": {
"imageReference": { "imageReference": {
"offer": "UbuntuServer", "offer": "UbuntuServer",
"publisher": "Canonical", "publisher": "Canonical",
"sku": "16.04", "sku": "16.04",
"version": "latest" "version": "latest"
}, },
"osDisk": { "osDisk": {
"caching": "ReadWrite", "caching": "ReadWrite",
"createOption": "FromImage", "createOption": "FromImage",
"name": "[parameters('osDiskName')]", "name": "[parameters('osDiskName')]",
"vhd": { "vhd": {
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]" "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]"
} }
} }
} }
}, },
"type": "Microsoft.Compute/virtualMachines" "type": "Microsoft.Compute/virtualMachines"
} }
], ],
"variables": { "variables": {
"addressPrefix": "10.0.0.0/16", "addressPrefix": "10.0.0.0/16",
"apiVersion": "2017-03-30", "apiVersion": "2017-03-30",
"location": "[resourceGroup().location]", "location": "[resourceGroup().location]",
"managedDiskApiVersion": "2017-03-30", "managedDiskApiVersion": "2017-03-30",
"networkInterfacesApiVersion": "2017-04-01", "networkInterfacesApiVersion": "2017-04-01",
"publicIPAddressApiVersion": "2017-04-01", "publicIPAddressApiVersion": "2017-04-01",
"publicIPAddressType": "Dynamic", "publicIPAddressType": "Dynamic",
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]", "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
"subnetAddressPrefix": "10.0.0.0/24", "subnetAddressPrefix": "10.0.0.0/24",
"subnetName": "[parameters('subnetName')]", "subnetName": "[parameters('subnetName')]",
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]", "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
"virtualNetworkName": "[parameters('virtualNetworkName')]", "virtualNetworkName": "[parameters('virtualNetworkName')]",
"virtualNetworkResourceGroup": "[resourceGroup().name]", "virtualNetworkResourceGroup": "[resourceGroup().name]",
"virtualNetworksApiVersion": "2017-04-01", "virtualNetworksApiVersion": "2017-04-01",
"vmStorageAccountContainerName": "images", "vmStorageAccountContainerName": "images",
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
} }
} }

View File

@ -1,173 +1,173 @@
{ {
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0", "contentVersion": "1.0.0.0",
"parameters": { "parameters": {
"adminPassword": { "adminPassword": {
"type": "string" "type": "string"
}, },
"adminUsername": { "adminUsername": {
"type": "string" "type": "string"
}, },
"dnsNameForPublicIP": { "dnsNameForPublicIP": {
"type": "string" "type": "string"
}, },
"nicName": { "nicName": {
"type": "string" "type": "string"
}, },
"osDiskName": { "osDiskName": {
"type": "string" "type": "string"
}, },
"publicIPAddressName": { "publicIPAddressName": {
"type": "string" "type": "string"
}, },
"storageAccountBlobEndpoint": { "storageAccountBlobEndpoint": {
"type": "string" "type": "string"
}, },
"subnetName": { "subnetName": {
"type": "string" "type": "string"
}, },
"virtualNetworkName": { "virtualNetworkName": {
"type": "string" "type": "string"
}, },
"vmName": { "vmName": {
"type": "string" "type": "string"
}, },
"vmSize": { "vmSize": {
"type": "string" "type": "string"
} }
}, },
"resources": [ "resources": [
{ {
"apiVersion": "[variables('publicIPAddressApiVersion')]", "apiVersion": "[variables('publicIPAddressApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('publicIPAddressName')]", "name": "[parameters('publicIPAddressName')]",
"properties": { "properties": {
"dnsSettings": { "dnsSettings": {
"domainNameLabel": "[parameters('dnsNameForPublicIP')]" "domainNameLabel": "[parameters('dnsNameForPublicIP')]"
}, },
"publicIPAllocationMethod": "[variables('publicIPAddressType')]" "publicIPAllocationMethod": "[variables('publicIPAddressType')]"
}, },
"type": "Microsoft.Network/publicIPAddresses" "type": "Microsoft.Network/publicIPAddresses"
}, },
{ {
"apiVersion": "[variables('virtualNetworksApiVersion')]", "apiVersion": "[variables('virtualNetworksApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[variables('virtualNetworkName')]", "name": "[variables('virtualNetworkName')]",
"properties": { "properties": {
"addressSpace": { "addressSpace": {
"addressPrefixes": [ "addressPrefixes": [
"[variables('addressPrefix')]" "[variables('addressPrefix')]"
] ]
}, },
"subnets": [ "subnets": [
{ {
"name": "[variables('subnetName')]", "name": "[variables('subnetName')]",
"properties": { "properties": {
"addressPrefix": "[variables('subnetAddressPrefix')]" "addressPrefix": "[variables('subnetAddressPrefix')]"
} }
} }
] ]
}, },
"type": "Microsoft.Network/virtualNetworks" "type": "Microsoft.Network/virtualNetworks"
}, },
{ {
"apiVersion": "[variables('networkInterfacesApiVersion')]", "apiVersion": "[variables('networkInterfacesApiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]", "[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]" "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('nicName')]", "name": "[parameters('nicName')]",
"properties": { "properties": {
"ipConfigurations": [ "ipConfigurations": [
{ {
"name": "ipconfig", "name": "ipconfig",
"properties": { "properties": {
"privateIPAllocationMethod": "Dynamic", "privateIPAllocationMethod": "Dynamic",
"publicIPAddress": { "publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]" "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
}, },
"subnet": { "subnet": {
"id": "[variables('subnetRef')]" "id": "[variables('subnetRef')]"
} }
} }
} }
] ]
}, },
"type": "Microsoft.Network/networkInterfaces" "type": "Microsoft.Network/networkInterfaces"
}, },
{ {
"apiVersion": "[variables('apiVersion')]", "apiVersion": "[variables('apiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]" "[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('vmName')]", "name": "[parameters('vmName')]",
"properties": { "properties": {
"diagnosticsProfile": { "diagnosticsProfile": {
"bootDiagnostics": { "bootDiagnostics": {
"enabled": false "enabled": false
} }
}, },
"hardwareProfile": { "hardwareProfile": {
"vmSize": "[parameters('vmSize')]" "vmSize": "[parameters('vmSize')]"
}, },
"networkProfile": { "networkProfile": {
"networkInterfaces": [ "networkInterfaces": [
{ {
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]" "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
} }
] ]
}, },
"osProfile": { "osProfile": {
"adminPassword": "[parameters('adminPassword')]", "adminPassword": "[parameters('adminPassword')]",
"adminUsername": "[parameters('adminUsername')]", "adminUsername": "[parameters('adminUsername')]",
"computerName": "[parameters('vmName')]", "computerName": "[parameters('vmName')]",
"linuxConfiguration": { "linuxConfiguration": {
"ssh": { "ssh": {
"publicKeys": [ "publicKeys": [
{ {
"keyData": "--test-ssh-authorized-key--", "keyData": "--test-ssh-authorized-key--",
"path": "[variables('sshKeyPath')]" "path": "[variables('sshKeyPath')]"
} }
] ]
} }
} }
}, },
"storageProfile": { "storageProfile": {
"osDisk": { "osDisk": {
"caching": "ReadWrite", "caching": "ReadWrite",
"createOption": "FromImage", "createOption": "FromImage",
"image": { "image": {
"uri": "http://azure/custom.vhd" "uri": "http://azure/custom.vhd"
}, },
"name": "[parameters('osDiskName')]", "name": "[parameters('osDiskName')]",
"osType": "Linux", "osType": "Linux",
"vhd": { "vhd": {
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]" "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]"
} }
} }
} }
}, },
"type": "Microsoft.Compute/virtualMachines" "type": "Microsoft.Compute/virtualMachines"
} }
], ],
"variables": { "variables": {
"addressPrefix": "10.0.0.0/16", "addressPrefix": "10.0.0.0/16",
"apiVersion": "2017-03-30", "apiVersion": "2017-03-30",
"location": "[resourceGroup().location]", "location": "[resourceGroup().location]",
"managedDiskApiVersion": "2017-03-30", "managedDiskApiVersion": "2017-03-30",
"networkInterfacesApiVersion": "2017-04-01", "networkInterfacesApiVersion": "2017-04-01",
"publicIPAddressApiVersion": "2017-04-01", "publicIPAddressApiVersion": "2017-04-01",
"publicIPAddressType": "Dynamic", "publicIPAddressType": "Dynamic",
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]", "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
"subnetAddressPrefix": "10.0.0.0/24", "subnetAddressPrefix": "10.0.0.0/24",
"subnetName": "[parameters('subnetName')]", "subnetName": "[parameters('subnetName')]",
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]", "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
"virtualNetworkName": "[parameters('virtualNetworkName')]", "virtualNetworkName": "[parameters('virtualNetworkName')]",
"virtualNetworkResourceGroup": "[resourceGroup().name]", "virtualNetworkResourceGroup": "[resourceGroup().name]",
"virtualNetworksApiVersion": "2017-04-01", "virtualNetworksApiVersion": "2017-04-01",
"vmStorageAccountContainerName": "images", "vmStorageAccountContainerName": "images",
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
} }
} }

View File

@ -1,135 +1,135 @@
{ {
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0", "contentVersion": "1.0.0.0",
"parameters": { "parameters": {
"adminPassword": { "adminPassword": {
"type": "string" "type": "string"
}, },
"adminUsername": { "adminUsername": {
"type": "string" "type": "string"
}, },
"dnsNameForPublicIP": { "dnsNameForPublicIP": {
"type": "string" "type": "string"
}, },
"nicName": { "nicName": {
"type": "string" "type": "string"
}, },
"osDiskName": { "osDiskName": {
"type": "string" "type": "string"
}, },
"publicIPAddressName": { "publicIPAddressName": {
"type": "string" "type": "string"
}, },
"storageAccountBlobEndpoint": { "storageAccountBlobEndpoint": {
"type": "string" "type": "string"
}, },
"subnetName": { "subnetName": {
"type": "string" "type": "string"
}, },
"virtualNetworkName": { "virtualNetworkName": {
"type": "string" "type": "string"
}, },
"vmName": { "vmName": {
"type": "string" "type": "string"
}, },
"vmSize": { "vmSize": {
"type": "string" "type": "string"
} }
}, },
"resources": [ "resources": [
{ {
"apiVersion": "[variables('networkInterfacesApiVersion')]", "apiVersion": "[variables('networkInterfacesApiVersion')]",
"dependsOn": [], "dependsOn": [],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('nicName')]", "name": "[parameters('nicName')]",
"properties": { "properties": {
"ipConfigurations": [ "ipConfigurations": [
{ {
"name": "ipconfig", "name": "ipconfig",
"properties": { "properties": {
"privateIPAllocationMethod": "Dynamic", "privateIPAllocationMethod": "Dynamic",
"subnet": { "subnet": {
"id": "[variables('subnetRef')]" "id": "[variables('subnetRef')]"
} }
} }
} }
] ]
}, },
"type": "Microsoft.Network/networkInterfaces" "type": "Microsoft.Network/networkInterfaces"
}, },
{ {
"apiVersion": "[variables('apiVersion')]", "apiVersion": "[variables('apiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]" "[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('vmName')]", "name": "[parameters('vmName')]",
"properties": { "properties": {
"diagnosticsProfile": { "diagnosticsProfile": {
"bootDiagnostics": { "bootDiagnostics": {
"enabled": false "enabled": false
} }
}, },
"hardwareProfile": { "hardwareProfile": {
"vmSize": "[parameters('vmSize')]" "vmSize": "[parameters('vmSize')]"
}, },
"networkProfile": { "networkProfile": {
"networkInterfaces": [ "networkInterfaces": [
{ {
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]" "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
} }
] ]
}, },
"osProfile": { "osProfile": {
"adminPassword": "[parameters('adminPassword')]", "adminPassword": "[parameters('adminPassword')]",
"adminUsername": "[parameters('adminUsername')]", "adminUsername": "[parameters('adminUsername')]",
"computerName": "[parameters('vmName')]", "computerName": "[parameters('vmName')]",
"linuxConfiguration": { "linuxConfiguration": {
"ssh": { "ssh": {
"publicKeys": [ "publicKeys": [
{ {
"keyData": "--test-ssh-authorized-key--", "keyData": "--test-ssh-authorized-key--",
"path": "[variables('sshKeyPath')]" "path": "[variables('sshKeyPath')]"
} }
] ]
} }
} }
}, },
"storageProfile": { "storageProfile": {
"osDisk": { "osDisk": {
"caching": "ReadWrite", "caching": "ReadWrite",
"createOption": "FromImage", "createOption": "FromImage",
"diskSizeGB": 100, "diskSizeGB": 100,
"image": { "image": {
"uri": "http://azure/custom.vhd" "uri": "http://azure/custom.vhd"
}, },
"name": "[parameters('osDiskName')]", "name": "[parameters('osDiskName')]",
"osType": "Linux", "osType": "Linux",
"vhd": { "vhd": {
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]" "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]"
} }
} }
} }
}, },
"type": "Microsoft.Compute/virtualMachines" "type": "Microsoft.Compute/virtualMachines"
} }
], ],
"variables": { "variables": {
"addressPrefix": "10.0.0.0/16", "addressPrefix": "10.0.0.0/16",
"apiVersion": "2017-03-30", "apiVersion": "2017-03-30",
"location": "[resourceGroup().location]", "location": "[resourceGroup().location]",
"managedDiskApiVersion": "2017-03-30", "managedDiskApiVersion": "2017-03-30",
"networkInterfacesApiVersion": "2017-04-01", "networkInterfacesApiVersion": "2017-04-01",
"publicIPAddressApiVersion": "2017-04-01", "publicIPAddressApiVersion": "2017-04-01",
"publicIPAddressType": "Dynamic", "publicIPAddressType": "Dynamic",
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]", "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
"subnetAddressPrefix": "10.0.0.0/24", "subnetAddressPrefix": "10.0.0.0/24",
"subnetName": "--subnet-name--", "subnetName": "--subnet-name--",
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]", "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
"virtualNetworkName": "--virtual-network--", "virtualNetworkName": "--virtual-network--",
"virtualNetworkResourceGroup": "--virtual-network-resource-group--", "virtualNetworkResourceGroup": "--virtual-network-resource-group--",
"virtualNetworksApiVersion": "2017-04-01", "virtualNetworksApiVersion": "2017-04-01",
"vmStorageAccountContainerName": "images", "vmStorageAccountContainerName": "images",
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
} }
} }

View File

@ -1,189 +1,189 @@
{ {
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0", "contentVersion": "1.0.0.0",
"parameters": { "parameters": {
"adminPassword": { "adminPassword": {
"type": "string" "type": "string"
}, },
"adminUsername": { "adminUsername": {
"type": "string" "type": "string"
}, },
"dnsNameForPublicIP": { "dnsNameForPublicIP": {
"type": "string" "type": "string"
}, },
"nicName": { "nicName": {
"type": "string" "type": "string"
}, },
"osDiskName": { "osDiskName": {
"type": "string" "type": "string"
}, },
"publicIPAddressName": { "publicIPAddressName": {
"type": "string" "type": "string"
}, },
"storageAccountBlobEndpoint": { "storageAccountBlobEndpoint": {
"type": "string" "type": "string"
}, },
"subnetName": { "subnetName": {
"type": "string" "type": "string"
}, },
"virtualNetworkName": { "virtualNetworkName": {
"type": "string" "type": "string"
}, },
"vmName": { "vmName": {
"type": "string" "type": "string"
}, },
"vmSize": { "vmSize": {
"type": "string" "type": "string"
} }
}, },
"resources": [ "resources": [
{ {
"apiVersion": "[variables('publicIPAddressApiVersion')]", "apiVersion": "[variables('publicIPAddressApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('publicIPAddressName')]", "name": "[parameters('publicIPAddressName')]",
"properties": { "properties": {
"dnsSettings": { "dnsSettings": {
"domainNameLabel": "[parameters('dnsNameForPublicIP')]" "domainNameLabel": "[parameters('dnsNameForPublicIP')]"
}, },
"publicIPAllocationMethod": "[variables('publicIPAddressType')]" "publicIPAllocationMethod": "[variables('publicIPAddressType')]"
}, },
"type": "Microsoft.Network/publicIPAddresses" "type": "Microsoft.Network/publicIPAddresses"
}, },
{ {
"apiVersion": "[variables('virtualNetworksApiVersion')]", "apiVersion": "[variables('virtualNetworksApiVersion')]",
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[variables('virtualNetworkName')]", "name": "[variables('virtualNetworkName')]",
"properties": { "properties": {
"addressSpace": { "addressSpace": {
"addressPrefixes": [ "addressPrefixes": [
"[variables('addressPrefix')]" "[variables('addressPrefix')]"
] ]
}, },
"subnets": [ "subnets": [
{ {
"name": "[variables('subnetName')]", "name": "[variables('subnetName')]",
"properties": { "properties": {
"addressPrefix": "[variables('subnetAddressPrefix')]" "addressPrefix": "[variables('subnetAddressPrefix')]"
} }
} }
] ]
}, },
"type": "Microsoft.Network/virtualNetworks" "type": "Microsoft.Network/virtualNetworks"
}, },
{ {
"apiVersion": "[variables('networkInterfacesApiVersion')]", "apiVersion": "[variables('networkInterfacesApiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]", "[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]" "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('nicName')]", "name": "[parameters('nicName')]",
"properties": { "properties": {
"ipConfigurations": [ "ipConfigurations": [
{ {
"name": "ipconfig", "name": "ipconfig",
"properties": { "properties": {
"privateIPAllocationMethod": "Dynamic", "privateIPAllocationMethod": "Dynamic",
"publicIPAddress": { "publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]" "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
}, },
"subnet": { "subnet": {
"id": "[variables('subnetRef')]" "id": "[variables('subnetRef')]"
} }
} }
} }
] ]
}, },
"type": "Microsoft.Network/networkInterfaces" "type": "Microsoft.Network/networkInterfaces"
}, },
{ {
"apiVersion": "[variables('apiVersion')]", "apiVersion": "[variables('apiVersion')]",
"dependsOn": [ "dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]" "[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
], ],
"location": "[variables('location')]", "location": "[variables('location')]",
"name": "[parameters('vmName')]", "name": "[parameters('vmName')]",
"properties": { "properties": {
"diagnosticsProfile": { "diagnosticsProfile": {
"bootDiagnostics": { "bootDiagnostics": {
"enabled": false "enabled": false
} }
}, },
"hardwareProfile": { "hardwareProfile": {
"vmSize": "[parameters('vmSize')]" "vmSize": "[parameters('vmSize')]"
}, },
"networkProfile": { "networkProfile": {
"networkInterfaces": [ "networkInterfaces": [
{ {
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]" "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
} }
] ]
}, },
"osProfile": { "osProfile": {
"adminPassword": "[parameters('adminPassword')]", "adminPassword": "[parameters('adminPassword')]",
"adminUsername": "[parameters('adminUsername')]", "adminUsername": "[parameters('adminUsername')]",
"computerName": "[parameters('vmName')]", "computerName": "[parameters('vmName')]",
"secrets": [ "secrets": [
{ {
"sourceVault": { "sourceVault": {
"id": "[resourceId(resourceGroup().name, 'Microsoft.KeyVault/vaults', '--test-key-vault-name')]" "id": "[resourceId(resourceGroup().name, 'Microsoft.KeyVault/vaults', '--test-key-vault-name')]"
}, },
"vaultCertificates": [ "vaultCertificates": [
{ {
"certificateStore": "My", "certificateStore": "My",
"certificateUrl": "--test-winrm-certificate-url--" "certificateUrl": "--test-winrm-certificate-url--"
} }
] ]
} }
], ],
"windowsConfiguration": { "windowsConfiguration": {
"provisionVMAgent": true, "provisionVMAgent": true,
"winRM": { "winRM": {
"listeners": [ "listeners": [
{ {
"certificateUrl": "--test-winrm-certificate-url--", "certificateUrl": "--test-winrm-certificate-url--",
"protocol": "https" "protocol": "https"
} }
] ]
} }
} }
}, },
"storageProfile": { "storageProfile": {
"imageReference": { "imageReference": {
"offer": "WindowsServer", "offer": "WindowsServer",
"publisher": "MicrosoftWindowsServer", "publisher": "MicrosoftWindowsServer",
"sku": "2012-R2-Datacenter", "sku": "2012-R2-Datacenter",
"version": "latest" "version": "latest"
}, },
"osDisk": { "osDisk": {
"caching": "ReadWrite", "caching": "ReadWrite",
"createOption": "FromImage", "createOption": "FromImage",
"name": "[parameters('osDiskName')]", "name": "[parameters('osDiskName')]",
"vhd": { "vhd": {
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]" "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]"
} }
} }
} }
}, },
"type": "Microsoft.Compute/virtualMachines" "type": "Microsoft.Compute/virtualMachines"
} }
], ],
"variables": { "variables": {
"addressPrefix": "10.0.0.0/16", "addressPrefix": "10.0.0.0/16",
"apiVersion": "2017-03-30", "apiVersion": "2017-03-30",
"location": "[resourceGroup().location]", "location": "[resourceGroup().location]",
"managedDiskApiVersion": "2017-03-30", "managedDiskApiVersion": "2017-03-30",
"networkInterfacesApiVersion": "2017-04-01", "networkInterfacesApiVersion": "2017-04-01",
"publicIPAddressApiVersion": "2017-04-01", "publicIPAddressApiVersion": "2017-04-01",
"publicIPAddressType": "Dynamic", "publicIPAddressType": "Dynamic",
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]", "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
"subnetAddressPrefix": "10.0.0.0/24", "subnetAddressPrefix": "10.0.0.0/24",
"subnetName": "[parameters('subnetName')]", "subnetName": "[parameters('subnetName')]",
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]", "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
"virtualNetworkName": "[parameters('virtualNetworkName')]", "virtualNetworkName": "[parameters('virtualNetworkName')]",
"virtualNetworkResourceGroup": "[resourceGroup().name]", "virtualNetworkResourceGroup": "[resourceGroup().name]",
"virtualNetworksApiVersion": "2017-04-01", "virtualNetworksApiVersion": "2017-04-01",
"vmStorageAccountContainerName": "images", "vmStorageAccountContainerName": "images",
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
} }
} }

View File

@ -1,44 +1,44 @@
{ {
"variables": { "variables": {
"client_id": "{{env `ARM_CLIENT_ID`}}", "client_id": "{{env `ARM_CLIENT_ID`}}",
"client_secret": "{{env `ARM_CLIENT_SECRET`}}", "client_secret": "{{env `ARM_CLIENT_SECRET`}}",
"resource_group": "{{env `ARM_RESOURCE_GROUP`}}", "resource_group": "{{env `ARM_RESOURCE_GROUP`}}",
"storage_account": "{{env `ARM_STORAGE_ACCOUNT`}}", "storage_account": "{{env `ARM_STORAGE_ACCOUNT`}}",
"subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}" "subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}"
}, },
"builders": [ "builders": [
{ {
"type": "azure-arm", "type": "azure-arm",
"client_id": "{{user `client_id`}}", "client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}", "client_secret": "{{user `client_secret`}}",
"resource_group_name": "{{user `resource_group`}}", "resource_group_name": "{{user `resource_group`}}",
"storage_account": "{{user `storage_account`}}", "storage_account": "{{user `storage_account`}}",
"subscription_id": "{{user `subscription_id`}}", "subscription_id": "{{user `subscription_id`}}",
"capture_container_name": "images", "capture_container_name": "images",
"capture_name_prefix": "packer", "capture_name_prefix": "packer",
"os_type": "Linux", "os_type": "Linux",
"image_url": "https://my-storage-account.blob.core.windows.net/path/to/your/custom/image.vhd", "image_url": "https://my-storage-account.blob.core.windows.net/path/to/your/custom/image.vhd",
"azure_tags": { "azure_tags": {
"dept": "engineering", "dept": "engineering",
"task": "image deployment" "task": "image deployment"
}, },
"location": "West US", "location": "West US",
"vm_size": "Standard_DS2_v2" "vm_size": "Standard_DS2_v2"
} }
], ],
"provisioners": [{ "provisioners": [{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'", "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [ "inline": [
"apt-get update", "apt-get update",
"apt-get upgrade -y", "apt-get upgrade -y",
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync" "/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
], ],
"inline_shebang": "/bin/sh -x", "inline_shebang": "/bin/sh -x",
"type": "shell" "type": "shell"
}] }]
} }

View File

@ -1,40 +1,40 @@
{ {
"variables": { "variables": {
"client_id": "{{env `ARM_CLIENT_ID`}}", "client_id": "{{env `ARM_CLIENT_ID`}}",
"client_secret": "{{env `ARM_CLIENT_SECRET`}}", "client_secret": "{{env `ARM_CLIENT_SECRET`}}",
"subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}" "subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}"
}, },
"builders": [ "builders": [
{ {
"type": "azure-arm", "type": "azure-arm",
"client_id": "{{user `client_id`}}", "client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}", "client_secret": "{{user `client_secret`}}",
"subscription_id": "{{user `subscription_id`}}", "subscription_id": "{{user `subscription_id`}}",
"os_type": "Linux", "os_type": "Linux",
"custom_managed_image_resource_group_name": "MyResourceGroup", "custom_managed_image_resource_group_name": "MyResourceGroup",
"custom_managed_image_name": "MyImage", "custom_managed_image_name": "MyImage",
"managed_image_resource_group_name": "PackerImages", "managed_image_resource_group_name": "PackerImages",
"managed_image_name": "MyImage", "managed_image_name": "MyImage",
"azure_tags": { "azure_tags": {
"dept": "engineering", "dept": "engineering",
"task": "image deployment" "task": "image deployment"
}, },
"location": "West US", "location": "West US",
"vm_size": "Standard_DS2_v2" "vm_size": "Standard_DS2_v2"
} }
], ],
"provisioners": [{ "provisioners": [{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'", "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [ "inline": [
"apt-get update", "apt-get update",
"apt-get upgrade -y", "apt-get upgrade -y",
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync" "/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
], ],
"inline_shebang": "/bin/sh -x", "inline_shebang": "/bin/sh -x",
"type": "shell" "type": "shell"
}] }]
} }

View File

@ -1,35 +1,35 @@
{ {
"variables": { "variables": {
"resource_group": "{{env `ARM_RESOURCE_GROUP`}}", "resource_group": "{{env `ARM_RESOURCE_GROUP`}}",
"storage_account": "{{env `ARM_STORAGE_ACCOUNT`}}", "storage_account": "{{env `ARM_STORAGE_ACCOUNT`}}",
"subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}" "subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}"
}, },
"builders": [{ "builders": [{
"type": "azure-arm", "type": "azure-arm",
"resource_group_name": "{{user `resource_group`}}", "resource_group_name": "{{user `resource_group`}}",
"storage_account": "{{user `storage_account`}}", "storage_account": "{{user `storage_account`}}",
"subscription_id": "{{user `subscription_id`}}", "subscription_id": "{{user `subscription_id`}}",
"capture_container_name": "images", "capture_container_name": "images",
"capture_name_prefix": "packer", "capture_name_prefix": "packer",
"os_type": "Linux", "os_type": "Linux",
"image_publisher": "Canonical", "image_publisher": "Canonical",
"image_offer": "UbuntuServer", "image_offer": "UbuntuServer",
"image_sku": "16.04-LTS", "image_sku": "16.04-LTS",
"location": "West US", "location": "West US",
"vm_size": "Standard_DS2_v2" "vm_size": "Standard_DS2_v2"
}], }],
"provisioners": [{ "provisioners": [{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'", "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [ "inline": [
"apt-get update", "apt-get update",
"apt-get upgrade -y", "apt-get upgrade -y",
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync" "/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
], ],
"inline_shebang": "/bin/sh -x", "inline_shebang": "/bin/sh -x",
"type": "shell" "type": "shell"
}] }]
} }

View File

@ -1,49 +1,49 @@
{ {
"variables": { "variables": {
"client_id": "{{env `ARM_CLIENT_ID`}}", "client_id": "{{env `ARM_CLIENT_ID`}}",
"client_secret": "{{env `ARM_CLIENT_SECRET`}}", "client_secret": "{{env `ARM_CLIENT_SECRET`}}",
"resource_group": "{{env `ARM_RESOURCE_GROUP`}}", "resource_group": "{{env `ARM_RESOURCE_GROUP`}}",
"storage_account": "{{env `ARM_STORAGE_ACCOUNT`}}", "storage_account": "{{env `ARM_STORAGE_ACCOUNT`}}",
"subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}", "subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}",
"object_id": "{{env `ARM_OJBECT_ID`}}" "object_id": "{{env `ARM_OJBECT_ID`}}"
}, },
"builders": [ "builders": [
{ {
"type": "azure-arm", "type": "azure-arm",
"client_id": "{{user `client_id`}}", "client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}", "client_secret": "{{user `client_secret`}}",
"resource_group_name": "{{user `resource_group`}}", "resource_group_name": "{{user `resource_group`}}",
"storage_account": "{{user `storage_account`}}", "storage_account": "{{user `storage_account`}}",
"subscription_id": "{{user `subscription_id`}}", "subscription_id": "{{user `subscription_id`}}",
"object_id": "{{user `object_id`}}", "object_id": "{{user `object_id`}}",
"capture_container_name": "images", "capture_container_name": "images",
"capture_name_prefix": "packer", "capture_name_prefix": "packer",
"os_type": "Windows", "os_type": "Windows",
"image_url": "https://my-storage-account.blob.core.windows.net/path/to/your/custom/image.vhd", "image_url": "https://my-storage-account.blob.core.windows.net/path/to/your/custom/image.vhd",
"azure_tags": { "azure_tags": {
"dept": "engineering", "dept": "engineering",
"task": "image deployment" "task": "image deployment"
}, },
"location": "West US", "location": "West US",
"vm_size": "Standard_DS2_v2" "vm_size": "Standard_DS2_v2"
} }
], ],
"provisioners": [{ "provisioners": [{
"type": "powershell", "type": "powershell",
"inline": [ "inline": [
" # NOTE: the following *3* lines are only needed if the you have installed the Guest Agent.", " # NOTE: the following *3* lines are only needed if the you have installed the Guest Agent.",
" while ((Get-Service RdAgent).Status -ne 'Running') { Start-Sleep -s 5 }", " while ((Get-Service RdAgent).Status -ne 'Running') { Start-Sleep -s 5 }",
" while ((Get-Service WindowsAzureTelemetryService).Status -ne 'Running') { Start-Sleep -s 5 }", " while ((Get-Service WindowsAzureTelemetryService).Status -ne 'Running') { Start-Sleep -s 5 }",
" while ((Get-Service WindowsAzureGuestAgent).Status -ne 'Running') { Start-Sleep -s 5 }", " while ((Get-Service WindowsAzureGuestAgent).Status -ne 'Running') { Start-Sleep -s 5 }",
"if( Test-Path $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml ){ rm $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml -Force}", "if( Test-Path $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml ){ rm $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml -Force}",
"& $env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /quiet /quit", "& $env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /quiet /quit",
"while($true) { $imageState = Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\State | Select ImageState; if($imageState.ImageState -ne 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') { Write-Output $imageState.ImageState; Start-Sleep -s 10 } else { break } }" "while($true) { $imageState = Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\State | Select ImageState; if($imageState.ImageState -ne 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') { Write-Output $imageState.ImageState; Start-Sleep -s 10 } else { break } }"
] ]
}] }]
} }

View File

@ -1,103 +1,103 @@
<# <#
.Synopsis .Synopsis
Build script for Packer. Build script for Packer.
.Description .Description
Build script for Packer for all supported platforms and architectures. Build script for Packer for all supported platforms and architectures.
By default the following OSs and architectures are targeted. By default the following OSs and architectures are targeted.
OS: OS:
* linux * linux
* darwin * darwin
* windows * windows
* freebsd * freebsd
* openbsd * openbsd
Architecture: Architecture:
* 386 * 386
* amd64 * amd64
* arm * arm
If the environment variable PACKER_DEV is defined, then the OS and If the environment variable PACKER_DEV is defined, then the OS and
architecture of the go binary in the path is used. architecture of the go binary in the path is used.
The built binary is stamped with the current version number of Packer, The built binary is stamped with the current version number of Packer,
the latest git commit, and +CHANGES if there are any outstanding the latest git commit, and +CHANGES if there are any outstanding
changes in the current repository, e.g. changes in the current repository, e.g.
Packer v0.10.1.dev (3c736322ba3a5fcb3a4e92394011a2e56f396da6+CHANGES) Packer v0.10.1.dev (3c736322ba3a5fcb3a4e92394011a2e56f396da6+CHANGES)
The build artifacts for the current OS and architecture are copied to The build artifacts for the current OS and architecture are copied to
bin and $GOPATH\bin. bin and $GOPATH\bin.
.Example .Example
.\scripts\build.ps1 .\scripts\build.ps1
#> #>
# This script builds the application from source for multiple platforms. # This script builds the application from source for multiple platforms.
# Get the parent directory of where this script is. # Get the parent directory of where this script is.
$DIR = [System.IO.Path]::GetDirectoryName($PSScriptRoot) $DIR = [System.IO.Path]::GetDirectoryName($PSScriptRoot)
# Change into that directory # Change into that directory
Push-Location $DIR | Out-Null Push-Location $DIR | Out-Null
# Get the git commit # Get the git commit
$GIT_COMMIT = $(git.exe rev-parse HEAD) $GIT_COMMIT = $(git.exe rev-parse HEAD)
git.exe status --porcelain | Out-Null git.exe status --porcelain | Out-Null
if ($LastExitCode -eq 0) { if ($LastExitCode -eq 0) {
$GIT_DIRTY = "+CHANGES" $GIT_DIRTY = "+CHANGES"
} }
# If its dev mode, only build for ourself # If its dev mode, only build for ourself
if (Test-Path env:PACKER_DEV) { if (Test-Path env:PACKER_DEV) {
$XC_OS=$(go.exe env GOOS) $XC_OS=$(go.exe env GOOS)
$XC_ARCH=$(go.exe env GOARCH) $XC_ARCH=$(go.exe env GOARCH)
} else { } else {
if (Test-Path env:XC_ARCH) { if (Test-Path env:XC_ARCH) {
$XC_ARCH = $(Get-Content env:XC_ARCH) $XC_ARCH = $(Get-Content env:XC_ARCH)
} else { } else {
$XC_ARCH="386 amd64 arm arm64 ppc64le" $XC_ARCH="386 amd64 arm arm64 ppc64le"
} }
if (Test-Path env:XC_OS) { if (Test-Path env:XC_OS) {
$XC_OS = $(Get-Content env:XC_OS) $XC_OS = $(Get-Content env:XC_OS)
} else { } else {
$XC_OS = "linux darwin windows freebsd openbsd solaris" $XC_OS = "linux darwin windows freebsd openbsd solaris"
} }
} }
# Delete the old dir # Delete the old dir
echo "==> Removing old directory..." echo "==> Removing old directory..."
Remove-Item -Recurse -ErrorAction Ignore -Force "bin\" Remove-Item -Recurse -ErrorAction Ignore -Force "bin\"
Remove-Item -Recurse -ErrorAction Ignore -Force "pkg\" Remove-Item -Recurse -ErrorAction Ignore -Force "pkg\"
New-Item -Type Directory -Name bin | Out-Null New-Item -Type Directory -Name bin | Out-Null
# Delete the old dir # Delete the old dir
echo "==> Building..." echo "==> Building..."
gox.exe ` gox.exe `
-os="${XC_OS}" ` -os="${XC_OS}" `
-arch="${XC_ARCH}" ` -arch="${XC_ARCH}" `
-ldflags "-X github.com/hashicorp/packer/version.GitCommit=${GIT_COMMIT}${GIT_DIRTY}" ` -ldflags "-X github.com/hashicorp/packer/version.GitCommit=${GIT_COMMIT}${GIT_DIRTY}" `
-output "pkg/{{.OS}}_{{.Arch}}/packer" ` -output "pkg/{{.OS}}_{{.Arch}}/packer" `
. .
if ($LastExitCode -ne 0) { if ($LastExitCode -ne 0) {
exit 1 exit 1
} }
# Move all the compiled things to the $GOPATH/bin # Move all the compiled things to the $GOPATH/bin
$GOPATH=$(go.exe env GOPATH) $GOPATH=$(go.exe env GOPATH)
# Copy our OS/Arch to the bin/ directory # Copy our OS/Arch to the bin/ directory
echo "==> Copying binaries for this platform..." echo "==> Copying binaries for this platform..."
Get-ChildItem ".\pkg\$(go env GOOS)_$(go env GOARCH)\" ` Get-ChildItem ".\pkg\$(go env GOOS)_$(go env GOARCH)\" `
|? { !($_.PSIsContainer) } ` |? { !($_.PSIsContainer) } `
|% { |% {
Copy-Item $_.FullName "bin\" Copy-Item $_.FullName "bin\"
Copy-Item $_.FullName "${GOPATH}\bin\" Copy-Item $_.FullName "${GOPATH}\bin\"
} }
# Done! # Done!
echo "`r`n==> Results:" echo "`r`n==> Results:"
Get-ChildItem bin\ Get-ChildItem bin\

File diff suppressed because it is too large Load Diff