Skip to content

Commit 791e863

Browse files
Merge pull request #267372 from tanmaygore/patch-24
Adding ARM Template sample for Auto Extension Upgrade
2 parents c49f629 + 050b806 commit 791e863

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

articles/virtual-machines/automatic-extension-upgrade.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,59 @@ az vmss extension set \
187187
--enable-auto-upgrade true
188188
```
189189

190+
### ARM template for Virtual Machines
191+
The following example describes how to set automatic extension upgrades for an extension (Dependency Agent Extension in this example) on a Virtual Machine using Azure Resource Manager
192+
193+
```json
194+
{
195+
"type": "Microsoft.Compute/virtualMachines/extensions",
196+
"location": "[resourceGroup().location]",
197+
"name": "<extensionName>",
198+
"dependsOn": [
199+
"[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
200+
],
201+
"properties": {
202+
"publisher": "Microsoft.Azure.Monitoring.DependencyAgent",
203+
"type": "DependencyAgentWindows",
204+
"typeHandlerVersion": "9.5",
205+
"autoUpgradeMinorVersion": true,
206+
"enableAutomaticUpgrade": true,
207+
"settings": {
208+
"enableAMA": "true"
209+
}
210+
}
211+
}
212+
```
213+
214+
### ARM template for Virtual Machine Scale Sets
215+
Use the following example to set automatic extension upgrade on the extension within the scale set model:
216+
217+
```json
218+
{
219+
"type": "Microsoft.Compute/virtualMachineScaleSets",
220+
"apiVersion": "2023-09-01",
221+
"name": "[variables('vmScaleSetName')]",
222+
"location": "[resourceGroup().location]",
223+
   "properties": {
224+
    "virtualMachineProfile": {
225+
"extensionProfile": {
226+
        "extensions": [{
227+
"name": "<extensionName>",
228+
"properties": {
229+
"publisher": "Microsoft.Azure.Monitoring.DependencyAgent",
230+
"type": "DependencyAgentWindows",
231+
"typeHandlerVersion": "9.5"
232+
"autoUpgradeMinorVersion": true,
233+
"enableAutomaticUpgrade": true,
234+
}
235+
}]
236+
     }
237+
     }
238+
    }
239+
}
240+
```
241+
242+
190243
## Extension upgrades with multiple extensions
191244

192245
A VM or Virtual Machine Scale Set can have multiple extensions with automatic extension upgrade enabled. The same VM or scale set can also have other extensions without automatic extension upgrade enabled.

0 commit comments

Comments
 (0)