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/tutorial-install-apps-cli.md
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,9 @@ In your current shell, create a file named *customConfig.json* and paste the fol
44
44
}
45
45
```
46
46
47
+
> [!NOTE]
48
+
> You may need to invert the use of the single (') and double quotes (") within the JSON block if you decide to reference the JSON directly (instead of referencing the *customConfig.json* file) in the *--settings* parameter below.
49
+
47
50
## Create a scale set
48
51
49
52
> [!IMPORTANT]
@@ -63,7 +66,6 @@ az vmss create \
63
66
--name myScaleSet \
64
67
--image Ubuntu2204 \
65
68
--orchestration-mode Flexible \
66
-
--upgrade-policy-mode Automatic \
67
69
--admin-username azureuser \
68
70
--generate-ssh-keys
69
71
```
@@ -83,13 +85,18 @@ az vmss extension set \
83
85
--settings customConfig.json
84
86
```
85
87
86
-
Each VM instance in the scale set downloads and runs the script from GitHub. In a more complex example, multiple application components and files could be installed. If the scale set is scaled up, the new VM instances automatically apply the same Custom Script Extension definition and install the required application.
87
-
88
88
> [!CAUTION]
89
89
> File names are case sensitive. Use the exact file name stated in these instructions to avoid failure.
90
90
91
+
## Update your scale set instances
92
+
To apply the custom script to all existing instances, perform a manual upgrade.
93
+
94
+
```azurecli-interactive
95
+
az vmss update-instances --resource-group myResourceGroup --name myScaleSet --instance-ids "*"
96
+
```
97
+
91
98
## Allow traffic to port 80
92
-
To allow traffic to the application, add a network security group rule.
99
+
To allow traffic to flow through the load balancer to the virtual machines the default network security group needs to be updated.
@@ -114,8 +121,6 @@ Enter the public IP address of the load balancer in to a web browser. The load b
114
121
Leave the web browser open so that you can see an updated version in the next step.
115
122
116
123
## Update app deployment
117
-
Throughout the lifecycle of a scale set, you might need to deploy an updated version of your application. With the Custom Script Extension, you can reference an updated deploy script and then reapply the extension to your scale set. When the scale set was created in a previous step, the `--upgrade-policy-mode` was set to *automatic*. This setting allows the VM instances in the scale set to automatically update and apply the latest version of your application.
118
-
119
124
In your current shell, create a file named *customConfigv2.json* and paste the following configuration. This definition runs an updated *v2* version of the application install script:
120
125
121
126
```json
@@ -125,7 +130,7 @@ In your current shell, create a file named *customConfigv2.json* and paste the f
125
130
}
126
131
```
127
132
128
-
Apply the Custom Script Extension configuration to the VM instances in your scale set again with [az vmss extension set](/cli/azure/vmss/extension). The *customConfigv2.json* is used to apply the updated version of the application:
133
+
Apply the Custom Script Extension configuration to the your scale set again with [az vmss extension set](/cli/azure/vmss/extension). The *customConfigv2.json* is used to apply the updated version of the application:
129
134
130
135
```azurecli-interactive
131
136
az vmss extension set \
@@ -137,7 +142,14 @@ az vmss extension set \
137
142
--settings @customConfigv2.json
138
143
```
139
144
140
-
Refresh your web browser to see the updated messaging.
145
+
## Update your scale set instances
146
+
To apply the updated custom script to all existing instances, perform a manual upgrade.
147
+
148
+
```azurecli-interactive
149
+
az vmss update-instances --resource-group myResourceGroup --name myScaleSet --instance-ids "*"
150
+
```
151
+
152
+
Refresh your web browser to see the updated application.
141
153
142
154

0 commit comments