diff --git a/101-tags-vm/README.md b/101-tags-vm/README.md new file mode 100644 index 000000000000..ff88e1bdf4c2 --- /dev/null +++ b/101-tags-vm/README.md @@ -0,0 +1,19 @@ +# Very simple deployment of an Windows VM with Tags + + + + + +Built by: [mmccrory](https://github.com/mmccrory) + +This template allows you to deploy a simple Windows VM using a few different options for the Windows version, using the latest patched version. This will deploy in West US on a D1 VM Size. This will include tags on the Virtual Machine, Storage Account, Publib IP, and the Virtual Network. + +Below are the parameters that the template expects: + +| Name | Description | +|:--- |:---| +| newStorageAccountName | Unique DNS Name for the Storage Account where the Virtual Machine's disks will be placed. | +| adminUsername | Username for the Virtual Machine | +| adminPassword | Password for the Virtual Machine | +| dnsNameForPublicIP | Unique DNS Name for the Public IP used to access the Virtual Machine. | +| windowsOSVersion | The Windows version for the VM. This will pick a fully patched image of this given Windows version. Allowed values: 2008-R2-SP1, 2012-Datacenter, 2012-R2-Datacenter, Windows-Server-Technical-Preview | diff --git a/101-tags-vm/azuredeploy.json b/101-tags-vm/azuredeploy.json new file mode 100644 index 000000000000..3ad7479b873e --- /dev/null +++ b/101-tags-vm/azuredeploy.json @@ -0,0 +1,204 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "newStorageAccountName": { + "type": "string", + "metadata": { + "description": "Unique DNS Name for the Storage Account where the Virtual Machine's disks will be placed." + } + }, + "adminUsername": { + "type": "string", + "metadata": { + "description": "Username for the Virtual Machine." + } + }, + "adminPassword": { + "type": "securestring", + "metadata": { + "description": "Password for the Virtual Machine." + } + }, + "dnsNameForPublicIP": { + "type": "string", + "metadata": { + "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." + } + }, + "windowsOSVersion": { + "type": "string", + "defaultValue": "2012-R2-Datacenter", + "allowedValues": [ + "2008-R2-SP1", + "2012-Datacenter", + "2012-R2-Datacenter" + ], + "metadata": { + "description": "The Windows version for the VM. This will pick a fully patched image of this given Windows version. Allowed values: 2008-R2-SP1, 2012-Datacenter, 2012-R2-Datacenter." + } + } + }, + "variables": { + "location": "West US", + "imagePublisher": "MicrosoftWindowsServer", + "imageOffer": "WindowsServer", + "OSDiskName": "osdiskforwindowssimple", + "nicName": "myVMNic", + "addressPrefix": "10.0.0.0/16", + "subnetName": "Subnet", + "subnetPrefix": "10.0.0.0/24", + "storageAccountType": "Standard_LRS", + "publicIPAddressName": "myPublicIP", + "publicIPAddressType": "Dynamic", + "vmStorageAccountContainerName": "vhds", + "vmName": "MyWindowsVM", + "vmSize": "Standard_D1", + "virtualNetworkName": "MyVNET", + "vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]", + "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]" + }, + "resources": [ + { + "type": "Microsoft.Storage/storageAccounts", + "name": "[parameters('newStorageAccountName')]", + "apiVersion": "2015-05-01-preview", + "location": "[variables('location')]", + "tags": { + "Department": "MyDepartment", + "Application": "MyApp1", + "Created By": "MyName", + "Type": "Storage Account" + }, + "properties": { + "accountType": "[variables('storageAccountType')]" + } + }, + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/publicIPAddresses", + "name": "[variables('publicIPAddressName')]", + "location": "[variables('location')]", + "tags": { + "Department": "MyDepartment", + "Application": "MyApp1", + "Created By": "MyName", + "Type": "Public IP" + }, + "properties": { + "publicIPAllocationMethod": "[variables('publicIPAddressType')]", + "dnsSettings": { + "domainNameLabel": "[parameters('dnsNameForPublicIP')]" + } + } + }, + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/virtualNetworks", + "name": "[variables('virtualNetworkName')]", + "location": "[variables('location')]", + "tags": { + "Department": "MyDepartment", + "Application": "MyApp1", + "Created By": "MyName", + "Type": "Virtual Network" + }, + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[variables('addressPrefix')]" + ] + }, + "subnets": [ + { + "name": "[variables('subnetName')]", + "properties": { + "addressPrefix": "[variables('subnetPrefix')]" + } + } + ] + } + }, + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/networkInterfaces", + "name": "[variables('nicName')]", + "location": "[variables('location')]", + "tags": { + "Department": "MyDepartment", + "Application": "MyApp1", + "Created By": "MyName", + "Type": "Network Interface" + }, + "dependsOn": [ + "[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]", + "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]" + ], + "properties": { + "ipConfigurations": [ + { + "name": "ipconfig1", + "properties": { + "privateIPAllocationMethod": "Dynamic", + "publicIPAddress": { + "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]" + }, + "subnet": { + "id": "[variables('subnetRef')]" + } + } + } + ] + } + }, + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Compute/virtualMachines", + "name": "[variables('vmName')]", + "location": "[variables('location')]", + "tags": { + "Department": "MyDepartment", + "Application": "MyApp1", + "Created By": "MyName", + "Type": "Virtual Machine" + }, + "dependsOn": [ + "[concat('Microsoft.Storage/storageAccounts/', parameters('newStorageAccountName'))]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]" + ], + "properties": { + "hardwareProfile": { + "vmSize": "[variables('vmSize')]" + }, + "osProfile": { + "computername": "[variables('vmName')]", + "adminUsername": "[parameters('adminUsername')]", + "adminPassword": "[parameters('adminPassword')]" + }, + "storageProfile": { + "imageReference": { + "publisher": "[variables('imagePublisher')]", + "offer": "[variables('imageOffer')]", + "sku" : "[parameters('windowsOSVersion')]", + "version":"latest" + }, + "osDisk" : { + "name": "osdisk", + "vhd": { + "uri": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',variables('OSDiskName'),'.vhd')]" + }, + "caching": "ReadWrite", + "createOption": "FromImage" + } + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]" + } + ] + } + } + } + ] +} diff --git a/101-tags-vm/azuredeploy.parameters.json b/101-tags-vm/azuredeploy.parameters.json new file mode 100644 index 000000000000..0751ad2c5eb7 --- /dev/null +++ b/101-tags-vm/azuredeploy.parameters.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "newStorageAccountName": { + "value": "" + }, + "adminUsername": { + "value": "" + }, + "adminPassword": { + "value": "" + }, + "dnsNameForPublicIP": { + "value": "" + } + } +} diff --git a/101-tags-vm/metadata.json b/101-tags-vm/metadata.json new file mode 100644 index 000000000000..4a975fc66dc1 --- /dev/null +++ b/101-tags-vm/metadata.json @@ -0,0 +1,7 @@ +{ + "itemDisplayName": "Deploy a simple Windows VM with tags in West US", + "description": "This template allows you to deploy a simple Windows VM with tags using a few different options for the Windows version, using the latest patched version. This will deploy in West US on a D1 VM Size. This will include tags on the Virtual Machine, Storage Account, Publib IP, and the Virtual Network.", + "summary": "This template takes a minimum amount of parameters and deploys a Windows VM with tags, using the latest patched version.", + "githubUsername": "mmccrory", + "dateUpdated": "2015-05-28" +}