Skip to content

Commit 81dd6de

Browse files
authored
Merge pull request #109192 from mumian/0326-vm-linux
make it compliant with the arm quickstart guidance
2 parents 78525fe + 1cce3aa commit 81dd6de

File tree

3 files changed

+42
-85
lines changed

3 files changed

+42
-85
lines changed

articles/virtual-machine-scale-sets/TOC.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313
href: quick-create-cli.md
1414
- name: Create with Azure PowerShell
1515
href: quick-create-powershell.md
16-
- name: Create with a template
16+
- name: Create with ARM template
1717
items:
1818
- name: Linux scale set
19+
displayName: ARM, resource manager
1920
href: quick-create-template-linux.md
2021
- name: Windows scale set
22+
displayName: ARM, resource manager
2123
href: quick-create-template-windows.md
2224
- name: Tutorials
2325
items:
@@ -229,7 +231,7 @@
229231
- name: Extension sequencing
230232
href: disk-encryption-extension-sequencing.md
231233
- name: Key vault for Azure Disk Encryption
232-
href: disk-encryption-key-vault.md
234+
href: disk-encryption-key-vault.md
233235
- name: Work with large scale sets
234236
href: virtual-machine-scale-sets-placement-groups.md
235237
- name: Convert a scale set template to use managed disk
-13.6 KB
Loading

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

Lines changed: 38 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,49 @@
11
---
2-
title: Quickstart - Create a Linux virtual machine scale set with an Azure template
2+
title: Quickstart - Create a Linux virtual machine scale set with an Azure Resource Manager template
33
description: Learn how to quickly create a Linux virtual machine scale with an Azure Resource Manager template that deploys a sample app and configures autoscale rules
44
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
---
1313

14-
# Quickstart: Create a Linux virtual machine scale set with an Azure template
14+
# Quickstart: Create a Linux virtual machine scale set with an Azure Resource Manager template
15+
1516
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.
1617

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

19-
[!INCLUDE [cloud-shell-try-it.md](../../includes/cloud-shell-try-it.md)]
22+
## Prerequisites
23+
24+
None.
25+
26+
## Create a scale set
2027

21-
If you choose to install and use the CLI locally, this tutorial requires that you are running the Azure CLI version 2.0.29 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI]( /cli/azure/install-azure-cli).
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, or Azure PowerShell, or from continuous integration / continuous delivery (CI/CD) pipelines.
2229

30+
### Review the template
2331

24-
## Define a scale set in a template
25-
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-bottle-autoscale/).
2633

27-
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-bottle-autoscale/azuredeploy.json" range="1-330" highlight="176-264":::
2835

29-
To create a scale with a template, you define the appropriate resources. The core parts of the virtual machine scale set resource type are:
36+
These resources are defined in the template:
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:
3047

3148
| Property | Description of property | Example template value |
3249
|------------------------------|----------------------------------------------------------|-------------------------------------------|
@@ -41,49 +58,10 @@ To create a scale with a template, you define the appropriate resources. The cor
4158
| osProfile.adminUsername | The username for each VM instance | azureuser |
4259
| osProfile.adminPassword | The password for each VM instance | P@ssw0rd! |
4360

44-
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.
45-
46-
```json
47-
{
48-
"type": "Microsoft.Compute/virtualMachineScaleSets",
49-
"name": "myScaleSet",
50-
"location": "East US",
51-
"apiVersion": "2017-12-01",
52-
"sku": {
53-
"name": "Standard_A1",
54-
"capacity": "2"
55-
},
56-
"properties": {
57-
"upgradePolicy": {
58-
"mode": "Automatic"
59-
},
60-
"virtualMachineProfile": {
61-
"storageProfile": {
62-
"osDisk": {
63-
"caching": "ReadWrite",
64-
"createOption": "FromImage"
65-
},
66-
"imageReference": {
67-
"publisher": "Canonical",
68-
"offer": "UbuntuServer",
69-
"sku": "16.04-LTS",
70-
"version": "latest"
71-
}
72-
},
73-
"osProfile": {
74-
"computerNamePrefix": "myvmss",
75-
"adminUsername": "azureuser",
76-
"adminPassword": "P@ssw0rd!"
77-
}
78-
}
79-
}
80-
}
81-
```
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.
8262

83-
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).
63+
#### Add a sample application
8464

85-
86-
## Add a sample application
8765
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:
8866

8967
- Extension type
@@ -92,40 +70,17 @@ To test your scale set, install a basic web application. When you deploy a scale
9270
- Location of configuration or install scripts
9371
- Commands to execute on the VM instances
9472

95-
The [Python HTTP server on Linux](https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-bottle-autoscale) template uses the Custom Script Extension to install [Bottle](https://bottlepy.org/docs/dev/), a Python web framework, and a simple HTTP server.
96-
97-
Two scripts are defined in **fileUris** - *installserver.sh*, and *workserver.py*. These files are downloaded from GitHub, then *commandToExecute* runs `bash installserver.sh` to install and configure the app:
98-
99-
```json
100-
"extensionProfile": {
101-
"extensions": [
102-
{
103-
"name": "AppInstall",
104-
"properties": {
105-
"publisher": "Microsoft.Azure.Extensions",
106-
"type": "CustomScript",
107-
"typeHandlerVersion": "2.0",
108-
"autoUpgradeMinorVersion": true,
109-
"settings": {
110-
"fileUris": [
111-
"https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-vmss-bottle-autoscale/installserver.sh",
112-
"https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-vmss-bottle-autoscale/workserver.py"
113-
],
114-
"commandToExecute": "bash installserver.sh"
115-
}
116-
}
117-
}
118-
]
119-
}
120-
```
73+
The template uses the Custom Script Extension to install [Bottle](https://bottlepy.org/docs/dev/), a Python web framework, and a simple HTTP server.
12174

75+
Two scripts are defined in **fileUris** - *installserver.sh*, and *workserver.py*. These files are downloaded from GitHub, then *commandToExecute* runs `bash installserver.sh` to install and configure the app.
12276

123-
## Deploy the template
124-
You can deploy the [Python HTTP server on Linux](https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-bottle-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.
77+
### Deploy the template
78+
79+
You can deploy the template by selecting 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.
12580

12681
[![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-bottle-autoscale%2Fazuredeploy.json)
12782

128-
You can also use the Azure CLI to install the Python HTTP server on Linux with [az group deployment create](/cli/azure/group/deployment) as follows:
83+
You can also deploy a Resource Manager template by using Azure CLI:
12984

13085
```azurecli-interactive
13186
# Create a resource group
@@ -139,8 +94,8 @@ az group deployment create \
13994

14095
Answer the prompts to provide a scale set name, instance count, and admin credentials for the VM instances. It takes a few minutes for the scale set and supporting resources to be created.
14196

97+
## Test the deployment
14298

143-
## Test your scale set
14499
To see your scale set in action, access the sample web application in a web browser. Obtain the public IP address of the load balancer with [az network public-ip list](/cli/azure/network/public-ip) as follows:
145100

146101
```azurecli-interactive
@@ -153,16 +108,16 @@ Enter the public IP address of the load balancer in to a web browser in the form
153108

154109
![Default web page in NGINX](media/virtual-machine-scale-sets-create-template/running-python-app.png)
155110

156-
157111
## Clean up resources
112+
158113
When no longer needed, you can use [az group delete](/cli/azure/group) to remove the resource group, scale set, and all related resources as follows. The `--no-wait` parameter returns control to the prompt without waiting for the operation to complete. The `--yes` parameter confirms that you wish to delete the resources without an additional prompt to do so.
159114

160115
```azurecli-interactive
161116
az group delete --name myResourceGroup --yes --no-wait
162117
```
163118

164-
165119
## Next steps
120+
166121
In this quickstart, you created a Linux scale set with an Azure template and used the Custom Script Extension to install a basic Python web server on the VM instances. To learn more, continue to the tutorial for how to create and manage Azure virtual machine scale sets.
167122

168123
> [!div class="nextstepaction"]

0 commit comments

Comments
 (0)