Azure VM Reset admin account

JS Code Coverage Part 2

Recently discovered the option to reset the username and password for the local administrator account for Azure VMs. I found this in Michael Washam’s, Automating Microsoft Azure Infrastructure Services, which is a pretty interesting book, however more on that later.

Reset Azure VM account script

I have only run into this scenario once before, while setting up a VM for educational purposes and learned my lessons (credential management, standardization, and automation are essential…).  I accepted that it was lost forever, and did a pretty awful job as an admin.

It’s essential to know the following:

  • The VM must have the Microsoft Azure Virtual Machine Agent installed

  • This only works for local accounts
  • VM reboot required.

The script

A bit about the book

Due to frequent changes with cloud services, books are outdated pretty fast. Buying an A to Z reference book for a boxed product is still worth it. However, this doesn’t apply to a cloud platform. I do believe that there is a market for books like these, covering a small area from a specific viewpoint.

As expected, the book covers scripting / automating Azure Infrastructure related resources covering Virtual Machines, Endpoints, load balancing, VM storage, and Virtual Networks. I’m more leaning towards the development side of Azure and was, therefore, able to grasp some knowledge on Virtual Networking, advanced VM options (Virtual Machine Extensions, Custom Script Extension), and Provisioning Linux VMs.

Can the same information be found on the internet? Well, yes, quite likely. But you have to be willing to plow through all the outdated resources, bundling this into something readable. I prefer buying his book, and it’s only $14 for the kindle.
Automating Microsoft Azure_Infrastructure Services
Publishers website:
http://shop.oreilly.com/product/0636920032380.do
Author:
Michael Washam https://twitter.com/mwashamtx

Post Navigation