Make Managing Your Azure Environment Even Easier with ControlUp

As we recently announced in our post about the release of  Real-Time DX v8.6, you can now add your Microsoft Azure environment as a monitored resource in ControlUp.

 

We have a lot of new metric goodness, including cost, size, performance, state, and other metrics from Azure entities such as subscriptions, resources groups, virtual machines (VMs), and virtual disks. But we want more. You want more. We all want more. MORE, I SAY!

To further extend the functionality of our Microsoft Azure integration, we have seven new scripts (the first of many), designed specifically for Azure. These new scripts allow you to do the following, straight from the Real-Time DX Console:

  • Run power actions, such as start, stop, and restart on a virtual machine (VM)
  • Change the disk type for a VM
  • Change the VM size
  • Connect to a virtual machine to RDP
  • Show a VM’s network configuration
  • Set a virtual machine’s boot diagnostics mode
  • Take a screenshot of a VM console

Each of these is available from ControlUp’s Script Action library and you can add them to your environment directly inside the console

But before you get started with these scripts, there are some prerequisites. First, you need to add your Azure environment as a monitored resource (this is pretty straightforward).

The second thing you will need is the Service Principal for Azure. You can, of course, use the existing one for your Azure connection (as created in the previous step), but we recommend setting up a new one just for running the scripts. You can make this a more restricted Service Principal for some extra safety, and for auditing it’s also useful to keep these separate.

Sound complicated? Of course not! Because we also created a script action for that! This script creates a local XML credential file on each target, which should be all Consoles machines and Monitors that will be used to run scripts against your Azure environment.

Here’s how to use it:

  1. In the Script Library in your console, find the script “AZ Store Azure Service Principal Credentials” and install them.
  2. Select all the machines for which you would like to create credential files, enter Azure Tenant ID, Application ID, and Client secret, and the files that will be created on all targeted machines. The username in the Shared Credentials in the script is part of the filename of the credentials, so each account has its own credentials file. 

 

AZ Store Microsoft Azure Credentials

Action Results: AZ Store Microsoft Azure Credentials

 

With the prerequisites out of the way, let’s take a look at all the new ControlUp Azure script goodness!

AZ Machine Power Action

This script can perform numerous power actions on an Azure machine: start, stop, shutdown, turnoff, restart, deallocate, or hibernate (hibernate is not possible in Azure yet, but it is an upcoming feature).

 

AZ Machine Power Action

Action Results: AZ Machine Power Action

 

AZ Change Machine Disk Type

This script can change the machine disk type to Standard_LRS, Premium_LRS, StandardSSD_LRS, UltrSSD_LRS, Premium_ZRS or StandardSSD_ZRS

 

AZ Change Machine Disk Type

Action Results: AZ Change Machine Disk Type

 

AZ Resize Machine

Who needs an Azure portal anyway? With this script, you can resize machines right from ControlUp! Specify the name—or partial name—of a VM size, such as B2s (note that the name of the new size must be unique).

Beware, if the machine is On it will reboot for this action. And make sure you get the machine type right; a mistake here can be quite costly…

 

AZ Resize Machine

Action Results: AZ Resize Machine

 

AZ RDP to Machine

If you have Microsoft Defender for Servers, you can RDP directly to a machine using JIT VM access. But not everybody is paying for that, and, using this script, we can do it for free. It creates the required public IP and NSG rule (if the machine does not have them yet) and launches MSTSC.EXE to start the remote session. And after you are done and close mstsc.exe, the public IP and NSG are automatically removed again (unless they already existed before the script was run, in which case they are left in place of course).

There is no need to configure any input parameters: simply enter the required credentials for your remote session as normal. Output is an RDP session, and when closed (if the script timer has not run out), output will show the rule has been removed again. 

NOTE: If the script has timed out because the session lasted longer than the script timer, the network rule is still removed, but the output will not show it.

 

Action Results: AZ RDP to Machine


AZ Show Machine Network Information

This script gets the details of the machine’s network configuration. No input is needed; just run it on the target:

 

Action Results: Show Machine Network Information

 

AZ Set Boot Diagnostics

This script can turn a machine’s Boot Diagnostics on or off. Azure Boot Diagnostics can help with analyzing boot failures and must be enabled for the AZ Get console screenshot script to work!

 

AZ Set Boot Diagnostics

Action Results: AZ Set Boot Diagnostics

 

AZ Get Console Screenshot

Sometimes a good old-fashioned screenshot is what you need. This script can take a screenshot of the console session of a machine and save it.

NOTE: Boot Diagnostics must be enabled for this script to work! 

 

AZ Get Console Screenshot

Your PC ran into a problem it couldn't handle, and now it needs to restart.

 


🙁 indeed… 

Our team is busily at work developing a slew of new, useful scripts We are working on additional scripts for Azure and Azure Virtual Desktop (AVD), including an extended cost report script. In fact, Trentent Tye (a Tech Person of Interest™️) is working on a cool trigger that can change the disk to a cheaper version when a machine is powered down, saving costs for these machines (and at X o’clock, the disk is changed back to a faster / more expensive type). These savings can quickly add up fast infor larger environments.

Once available, we will have some deep-dive posts on our blog. But we can always do more! If there any Azure related scripts you would like to see, please let us know at script-suggestions@controlup.com. In the meantime, if you are not a ControlUp Real-Time DX customer yet, get started with a free trial today!

 

ControlUp Digital Employee Experience Management

 

About the author

Ton de Vreede

Ton de Vreede has worked in IT over 20 years, 17 of those in the virtualization space. He specializes in end-user computing and RDS environments, and anything to do with virtualization. He joined ControlUp to bring you even better script actions and automation; his personal motto is: spare the admin, automate! Ton’s a PowerShell junkie, loves to work with electronics, and also plays guitar, harmonica, and keyboard (badly).