I am trying to change the linux hostname using ARM Template , find my code below
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"apiVersion": "2019-12-01",
"name": "[concat('VMName','/HostnameChange')]",
"location": "Central US",
"copy": {
"name": "HostnameCopy",
"count": 1
},
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.1",
"autoUpgradeMinorVersion": true,
"settings": {
"skipDos2Unix": false
},
"protectedSettings": {
"commandToExecute": "hostnamectl set-hostname VMName"
}
}
}
Kindly help me to resolve