It's an old post but it happens sometimes. Here is what I solved after research.
sample log
$ azure vm extension set hm hm CustomScript Microsoft.Azure.Extensions 2.0 --auto-upgrade-minor-version -i '{"commandToExecute": "cp /tmp/sudoers.org /etc/sudoers"}' info: Executing command vm extension set
+ Looking up the VM "hm"
+ Installing extension "CustomScript", VM: "hm" info: vm extension set command OK
For macOS user, here is simple steps. (at least you need node installed)
npm install -g azure-cli
azure login
azure config mode arm
or asm, depends on your VM
azure vm list
change mode if no VM listed
copy sudoers file from other machine to /tmp/sudoers.default of you target machine
backup sudoers
azure vm extension set hm hm CustomScript Microsoft.Azure.Extensions 2.0 --auto-upgrade-minor-version -i '{"commandToExecute": "cp /etc/sudoers /tmp"}'
copy default sudoers to /etc/sudoers
azure vm extension set hm hm CustomScript Microsoft.Azure.Extensions 2.0 --auto-upgrade-minor-version -i '{"commandToExecute": "cp /tmp/sudoers.default /etc/sudoers"}'