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-linux.md
+38-83Lines changed: 38 additions & 83 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,32 +1,49 @@
1
1
---
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
3
3
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
4
4
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
---
13
13
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
+
15
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.
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.
22
29
30
+
### Review the template
23
31
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/).
26
33
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.
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:
30
47
31
48
| Property | Description of property | Example template value |
@@ -41,49 +58,10 @@ To create a scale with a template, you define the appropriate resources. The cor
41
58
| osProfile.adminUsername | The username for each VM instance | azureuser |
42
59
| osProfile.adminPassword | The password for each VM instance | P@ssw0rd! |
43
60
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.
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.
82
62
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
84
64
85
-
86
-
## Add a sample application
87
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:
88
66
89
67
- Extension type
@@ -92,40 +70,17 @@ To test your scale set, install a basic web application. When you deploy a scale
92
70
- Location of configuration or install scripts
93
71
- Commands to execute on the VM instances
94
72
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:
The template uses the Custom Script Extension to install [Bottle](https://bottlepy.org/docs/dev/), a Python web framework, and a simple HTTP server.
121
74
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.
122
76
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.
125
80
126
81
[](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)
127
82
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:
129
84
130
85
```azurecli-interactive
131
86
# Create a resource group
@@ -139,8 +94,8 @@ az group deployment create \
139
94
140
95
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.
141
96
97
+
## Test the deployment
142
98
143
-
## Test your scale set
144
99
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:
145
100
146
101
```azurecli-interactive
@@ -153,16 +108,16 @@ Enter the public IP address of the load balancer in to a web browser in the form
153
108
154
109

155
110
156
-
157
111
## Clean up resources
112
+
158
113
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.
159
114
160
115
```azurecli-interactive
161
116
az group delete --name myResourceGroup --yes --no-wait
162
117
```
163
118
164
-
165
119
## Next steps
120
+
166
121
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.
0 commit comments