You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-machine-scale-sets/quick-create-template-windows.md
+34-82Lines changed: 34 additions & 82 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,8 @@ author: cynthn
5
5
tags: azure-resource-manager
6
6
ms.service: virtual-machine-scale-sets
7
7
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
10
10
ms.author: cynthn
11
11
12
12
---
@@ -15,17 +15,35 @@ ms.author: cynthn
15
15
16
16
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.
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.
21
29
30
+
### Review the template
22
31
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/).
25
33
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.
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:
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:
29
47
30
48
| Property | Description of property | Example template value |
@@ -40,49 +58,10 @@ A template defines the configuration for each resource type. A virtual machine s
40
58
| osProfile.adminUsername | The username for each VM instance | azureuser |
41
59
| osProfile.adminPassword | The password for each VM instance | P@ssw0rd! |
42
60
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.
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.
83
62
63
+
#### Add a sample application
84
64
85
-
## Add a sample application
86
65
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:
87
66
88
67
- Extension type
@@ -91,44 +70,17 @@ To test your scale set, install a basic web application. When you deploy a scale
91
70
- Location of configuration or install scripts
92
71
- Commands to execute on the VM instances
93
72
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.
95
74
96
75
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*:
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.
128
80
129
81
[](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)
130
82
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:
132
84
133
85
```azurepowershell-interactive
134
86
# Create a resource group
@@ -148,8 +100,8 @@ Update-AzVmss `
148
100
149
101
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.
150
102
103
+
## Test the deployment
151
104
152
-
## Test your scale set
153
105
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:
154
106
155
107
```azurepowershell-interactive
@@ -160,16 +112,16 @@ Enter the public IP address of the load balancer in to a web browser in the form
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.
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.
0 commit comments