Azure Tags and Virtual Machines

February 25, 2023 By JeffTechs

I have been incredibly remiss the last 6 months. After passing my last certification, I moved onto studying AWS while setting up Intune and AutoPilot at my previous organization; also, I was looking for Federal employment and planning a cross country move.

The good news is that all of those projects are complete. On the flip side, I’ve been “drinking from the firehose” with the new job. It’s not my first time, but passion projects can be pushed back in those circumstances. But enough about me, it’s script time.

While I was gaining insight into my new organization–checking virtual networks, subnets, machines, tags, etc.–I found a lot of opportunity to create new scripts to gain visibility, and make it easier if this process happened again. In other words, write scripts to make onboarding easier for myself and others.

This was one of the first ones I wrote. This script will cycle through each subscription, find each virtual machine, and print the tags of that VM–with the associate VM name. This is written to export to a text file. It can be altered pretty easily to print in the shell. Readability could be an issue, though.

Here’s the link to my GitHub repo. It’s only three lines of code, so it can be copied over easily. Enjoy,