Skip to content

Instantly share code, notes, and snippets.

View ahovgaard's full-sized avatar

Anders Kiel Hovgaard ahovgaard

View GitHub Profile
@agolomoodysaada
agolomoodysaada / update-vmss-ssh-key.sh
Last active January 26, 2024 03:09
Azure Virtual Machine Scale Set(VMSS) Reset SSH KEY
az vmss extension set \
--vmss-name <vmss-name> \
-g <resource-group> \
-n VMAccessForLinux \
--publisher Microsoft.OSTCExtensions \
--version 1.4 \
--protected-settings "{\"username\":\"deploy_user\", \"ssh_key\":\"$(cat ~/.ssh/id_rsa.pub)\"}"
# Upgrade ALL instances in the scale set with the new key
az vmss update-instances --instance-ids '*'
-n <vmss-name>