Skip to content

Instantly share code, notes, and snippets.

@mjudeikis
Forked from agolomoodysaada/update-vmss-ssh-key.sh
Created November 9, 2018 10:05
Show Gist options
  • Save mjudeikis/0e8211465304a10657fc918041fc4e26 to your computer and use it in GitHub Desktop.
Save mjudeikis/0e8211465304a10657fc918041fc4e26 to your computer and use it in GitHub Desktop.
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>
-g <resource-group>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment