When you want to install the BGInfo VM extension during the Azure VM deployment through an ARM template, then you have to add the following lines to your template.
{
"apiVersion": "2015-06-15",
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(variables('vmName'),'/', parameters('vmBGInfo'))]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
],
"properties": {
"publisher": "Microsoft.Compute",
"type": "BGInfo",
"typeHandlerVersion": "2.1",
"settings": {},
"protectedSettings": null
}
}
For your template you have to customize the properties name, location and dependsOn. The lines have to be placed under resources after the VM definition in your template.
After a successful deployment you should see the informations provided by the BGInfo extension at your first RDP login.