how to execute ARM template whenever System Managed Identity is turned on VMSS (Virtual Machine Scale Set).
Asked
Active
Viewed 136 times
0
-
is it an existing VMSS for which you want to update the identity part using ARM template? – Ansuman Bal Feb 17 '22 at 06:14
-
@AnsumanBal-MT Yes we want to do for existing VMSS – dev4java Feb 17 '22 at 13:11
-
@AnsumanBal-MT Your template looks like to turn on the Managed identify, but our requirement is something like event/trigger, whenever system identity is turned on my ARM template should be executed automatically – dev4java Feb 19 '22 at 08:12
1 Answers
0
You can use the below template for your requirement:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "String"
},
"virtualMachineScaleSetName": {
"type": "String"
}
},
"variables": {
"virtualMachineScaleSetApiVersion": "2021-04-01"
},
"resources": [
{
"type": "Microsoft.Compute/virtualMachineScaleSets",
"apiVersion": "[variables('virtualMachineScaleSetApiVersion')]",
"name": "[parameters('virtualMachineScaleSetName')]",
"location": "[parameters('location')]",
"identity": {
"type" : "SystemAssigned"
}
}
]
}
Existing VMSS:
Running the Template:
Output:

Ansuman Bal
- 9,705
- 2
- 10
- 27