A blog about my exerience with Clouds, Automation and Virtualization

Using Azure Automation to check health of Minecraft server in Azure

As every responsible dad out there I have set up an Minecraft server to my daughter so she can play with her friends!

I have deployed a Windows Server on Azure in which I installed the Minecraft server with the right mods, apparently that is important 😉 I have not myself got lost in the Minecraft world, maybe because I grew up in the 80´s and had games that was mega-pixel and now I want that high definition graphics!

To see that it is working and alive I wanted some kind health check so here Azure Automation comes into play! Of course there would have been easier ways but I want try new stuff and also test and see how Azure Automation works and can be utilized.

So I created a runbook that checks the status and try to remediate the issue if it is not working:

Manage-Minecraft

PowerShell

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

workflowManage-MineCraft

{

# Easy script to check health of my daughters Minecraft server and take action if stopped

I have utilised the YAMS so that the Minecraft Server is handled by a Windows Service. If there is some outage or maintenance on Azure the VM can be restarted and then it is good to know that the Minecraft Server will start even if no user is logged in. If for some reason the YAMS service is stopped or the Minecraft Server has stopped my runbook can remidiate that!

In Azure Automation I can schedule a check every 1 hour:

And as you can see when checking a job it reports that my Minecraft server is working!

To connect to the VM´s powershell endpoint I have added SessionOption -SkipCACheck thus letting me connect without getting a cert from a trusted certificate authority or importing the servers cert. Saw this option on Tim´s blog post and borrowed it:-)

In the deployed VM I have also done as explained in the PowerShell Tip from powershell.com to be able to connect to it as it is not part of a domain and when PowerShell remoting is enabled it uses Kerberos by default and the Minecraft server is standalone thus Kerberos not working!

Probably I will do some tweaking and update the script later but you can at least see the possibilities and power of using Azure automation!