Skip to content

Commit 80bb695

Browse files
Merge pull request #109326 from mumian/0326-vm-win
make the article compliant with the ARM quickstart guidance
2 parents e6009d1 + 55c5de1 commit 80bb695

File tree

1 file changed

+34
-82
lines changed

1 file changed

+34
-82
lines changed

articles/virtual-machine-scale-sets/quick-create-template-windows.md

Lines changed: 34 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ author: cynthn
55
tags: azure-resource-manager
66
ms.service: virtual-machine-scale-sets
77
ms.topic: quickstart
8-
ms.custom: mvc
9-
ms.date: 03/27/2018
8+
ms.custom: mvc,subject-armqs
9+
ms.date: 03/27/2020
1010
ms.author: cynthn
1111

1212
---
@@ -15,17 +15,35 @@ ms.author: cynthn
1515

1616
A virtual machine scale set allows you to deploy and manage a set of identical, auto-scaling virtual machines. You can scale the number of VMs in the scale set manually, or define rules to autoscale based on resource usage like CPU, memory demand, or network traffic. An Azure load balancer then distributes traffic to the VM instances in the scale set. In this quickstart, you create a virtual machine scale set and deploy a sample application with an Azure Resource Manager template.
1717

18+
[!INCLUDE [About Azure Resource Manager](../../includes/resource-manager-quickstart-introduction.md)]
19+
1820
If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
1921

20-
[!INCLUDE [cloud-shell-try-it.md](../../includes/cloud-shell-try-it.md)]
22+
## Prerequisites
23+
24+
None.
25+
26+
## Create a scale set
27+
28+
Azure Resource Manager templates let you deploy groups of related resources. In a single template, you can create the virtual machine scale set, install applications, and configure autoscale rules. With the use of variables and parameters, this template can be reused to update existing, or create additional, scale sets. You can deploy templates through the Azure portal, Azure CLI, Azure PowerShell, or from continuous integration / continuous delivery (CI/CD) pipelines.
2129

30+
### Review the template
2231

23-
## Define a scale set in a template
24-
Azure Resource Manager templates let you deploy groups of related resources. Templates are written in JavaScript Object Notation (JSON) and define the entire Azure infrastructure environment for your application. In a single template, you can create the virtual machine scale set, install applications, and configure autoscale rules. With the use of variables and parameters, this template can be reused to update existing, or create additional, scale sets. You can deploy templates through the Azure portal, Azure CLI, or Azure PowerShell, or from continuous integration / continuous delivery (CI/CD) pipelines.
32+
The template used in this quickstart is from [Azure Quickstart templates](https://azure.microsoft.com/resources/templates/201-vmss-windows-webapp-dsc-autoscale/).
2533

26-
For more information on templates, see [Azure Resource Manager overview](https://docs.microsoft.com/azure/azure-resource-manager/template-deployment-overview#template-deployment-process). For JSON syntax and properties, see [Microsoft.Compute/virtualMachineScaleSets](/azure/templates/microsoft.compute/virtualmachinescalesets) template reference.
34+
:::code language="json" source="~/quickstart-templates/201-vmss-windows-webapp-dsc-autoscale/azuredeploy.json" range="1-397" highlight="236-325":::
2735

28-
A template defines the configuration for each resource type. A virtual machine scale set resource type is similar to an individual VM. The core parts of the virtual machine scale set resource type are:
36+
These resources are defined in these templates:
37+
38+
- [**Microsoft.Network/virtualNetworks**](/azure/templates/microsoft.network/virtualnetworks)
39+
- [**Microsoft.Network/publicIPAddresses**](/azure/templates/microsoft.network/publicipaddresses)
40+
- [**Microsoft.Network/loadBalancers**](/azure/templates/microsoft.network/loadbalancers)
41+
- [**Microsoft.Compute/virtualMachineScaleSets**](/azure/templates/microsoft.compute/virtualmachinescalesets)
42+
- [**Microsoft.Insights/autoscaleSettings**](/azure/templates/microsoft.insights/autoscalesettings)
43+
44+
#### Define a scale set
45+
46+
The highlighted portion is the scale set resource definition. To create a scale with a template, you define the appropriate resources. The core parts of the virtual machine scale set resource type are:
2947

3048
| Property | Description of property | Example template value |
3149
|------------------------------|----------------------------------------------------------|-------------------------------------------|
@@ -40,49 +58,10 @@ A template defines the configuration for each resource type. A virtual machine s
4058
| osProfile.adminUsername | The username for each VM instance | azureuser |
4159
| osProfile.adminPassword | The password for each VM instance | P@ssw0rd! |
4260

43-
The following example shows the core scale set resource definition. To customize a scale set template, you can change the VM size or initial capacity, or use a different platform or a custom image.
44-
45-
```json
46-
{
47-
"type": "Microsoft.Compute/virtualMachineScaleSets",
48-
"name": "myScaleSet",
49-
"location": "East US",
50-
"apiVersion": "2017-12-01",
51-
"sku": {
52-
"name": "Standard_A1",
53-
"capacity": "2"
54-
},
55-
"properties": {
56-
"upgradePolicy": {
57-
"mode": "Automatic"
58-
},
59-
"virtualMachineProfile": {
60-
"storageProfile": {
61-
"osDisk": {
62-
"caching": "ReadWrite",
63-
"createOption": "FromImage"
64-
},
65-
"imageReference": {
66-
"publisher": "MicrosoftWindowsServer",
67-
"offer": "WindowsServer",
68-
"sku": "2016-Datacenter",
69-
"version": "latest"
70-
}
71-
},
72-
"osProfile": {
73-
"computerNamePrefix": "myvmss",
74-
"adminUsername": "azureuser",
75-
"adminPassword": "P@ssw0rd!"
76-
}
77-
}
78-
}
79-
}
80-
```
81-
82-
To keep the sample short, the virtual network interface card (NIC) configuration is not shown. Additional components, such as a load balancer, are also not shown. A complete scale set template is shown [at the end of this article](#deploy-the-template).
61+
To customize a scale set template, you can change the VM size or initial capacity. Another option is to use a different platform or a custom image.
8362

63+
#### Add a sample application
8464

85-
## Add a sample application
8665
To test your scale set, install a basic web application. When you deploy a scale set, VM extensions can provide post-deployment configuration and automation tasks, such as installing an app. Scripts can be downloaded from Azure storage or GitHub, or provided to the Azure portal at extension run-time. To apply an extension to your scale set, you add the *extensionProfile* section to the preceding resource example. The extension profile typically defines the following properties:
8766

8867
- Extension type
@@ -91,44 +70,17 @@ To test your scale set, install a basic web application. When you deploy a scale
9170
- Location of configuration or install scripts
9271
- Commands to execute on the VM instances
9372

94-
The [ASP.NET application on Windows](https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-windows-webapp-dsc-autoscale) sample template uses the PowerShell DSC extension to install an ASP.NET MVC app that runs in IIS.
73+
The template uses the PowerShell DSC extension to install an ASP.NET MVC app that runs in IIS.
9574

9675
An install script is downloaded from GitHub, as defined in *url*. The extension then runs *InstallIIS* from the *IISInstall.ps1* script, as defined in *function* and *Script*. The ASP.NET app itself is provided as a Web Deploy package, which is also downloaded from GitHub, as defined in *WebDeployPackagePath*:
9776

98-
```json
99-
"extensionProfile": {
100-
"extensions": [
101-
{
102-
"name": "Microsoft.Powershell.DSC",
103-
"properties": {
104-
"publisher": "Microsoft.Powershell",
105-
"type": "DSC",
106-
"typeHandlerVersion": "2.9",
107-
"autoUpgradeMinorVersion": true,
108-
"forceUpdateTag": "1.0",
109-
"settings": {
110-
"configuration": {
111-
"url": "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-vmss-windows-webapp-dsc-autoscale/DSC/IISInstall.ps1.zip",
112-
"script": "IISInstall.ps1",
113-
"function": "InstallIIS"
114-
},
115-
"configurationArguments": {
116-
"nodeName": "localhost",
117-
"WebDeployPackagePath": "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-vmss-windows-webapp-dsc-autoscale/WebDeploy/DefaultASPWebApp.v1.0.zip"
118-
}
119-
}
120-
}
121-
}
122-
]
123-
}
124-
```
125-
12677
## Deploy the template
127-
You can deploy the [ASP.NET MVC application on Windows](https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-windows-webapp-dsc-autoscale) template with the following **Deploy to Azure** button. This button opens the Azure portal, loads the complete template, and prompts for a few parameters such as a scale set name, instance count, and admin credentials.
78+
79+
You can deploy the template by selecting the **Deploy to Azure** button. This button opens the Azure portal, loads the complete template, and prompts for a few parameters such as a scale set name, instance count, and admin credentials.
12880

12981
[![Deploy template to Azure](media/virtual-machine-scale-sets-create-template/deploy-button.png)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F201-vmss-windows-webapp-dsc-autoscale%2Fazuredeploy.json)
13082

131-
You can also use Azure PowerShell to install the ASP.NET application on Windows with [New-AzResourceGroupDeployment](/powershell/module/az.resources/new-azresourcegroupdeployment) as follows:
83+
You can also deploy a Resource Manager template by using Azure PowerShell:
13284

13385
```azurepowershell-interactive
13486
# Create a resource group
@@ -148,8 +100,8 @@ Update-AzVmss `
148100

149101
Answer the prompts to provide a scale set name and admin credentials for the VM instances. It can take 10-15 minutes for the scale set to be created and apply the extension to configure the app.
150102

103+
## Test the deployment
151104

152-
## Test your scale set
153105
To see your scale set in action, access the sample web application in a web browser. Obtain the public IP address of your load balancer with [Get-AzPublicIpAddress](/powershell/module/az.network/get-azpublicipaddress) as follows:
154106

155107
```azurepowershell-interactive
@@ -160,16 +112,16 @@ Enter the public IP address of the load balancer in to a web browser in the form
160112

161113
![Running IIS site](./media/virtual-machine-scale-sets-create-powershell/running-iis-site.png)
162114

163-
164115
## Clean up resources
116+
165117
When no longer needed, you can use the [Remove-AzResourceGroup](/powershell/module/az.resources/remove-azresourcegroup) to remove the resource group, scale set. The `-Force` parameter confirms that you wish to delete the resources without an additional prompt to do so. The `-AsJob` parameter returns control to the prompt without waiting for the operation to complete.
166118

167119
```azurepowershell-interactive
168120
Remove-AzResourceGroup -Name "myResourceGroup" -Force -AsJob
169121
```
170122

171-
172123
## Next steps
124+
173125
In this quickstart, you created a Windows scale set with an Azure template and used the PowerShell DSC extension to install a basic ASP.NET app on the VM instances. To learn more, continue to the tutorial for how to create and manage Azure virtual machine scale sets.
174126

175127
> [!div class="nextstepaction"]

0 commit comments

Comments
 (0)