Yes, the title reads right. I'm talking about running Bash, the Unix Shell on Windows. Well, on the Ubuntu subsystem running inside the Windows 10 OS. It's a bit weird, I know. And yet so cool and forward thinking.
If you need more info about how this works, you can check this MSDN article that also provides links to related posts. And these people have done a great job explaining in depth how it all hangs together. They also provide installation and usage instructions which are miles better than mine.
But I'm too excited not to share. Because today, this addition to Windows made my life so much easier. I was able to work with the native tools to manage a Linux cluster. By now, my past self would be horrified with the sentence I just wrote because I hadn't touched Linux for a very long time. Let alone deploy and manage a Linux cluster on Azure! And I did it all through the command line. I was even offered the option to perform the same tasks through the GUI but I ignored it! I still chose the command line as it was faster!
The fact that got me so excited is that I was able to perform some really complex workloads all through the command line (OK, and a little bit of Visual Studio Code). It was faster and easier all together, even with the learning curve involved. What tasks did I perform you may ask?
- I forked the [Azure Quick Start Template() GitHub repo
- Copied it locally (
- Edited the necessary ARM template in VS Code
- Saved and push my changes to the remote (
- Run the ARM template with Powershell
- Installed the MySQL client on Ubuntu through bash
- Logged into the newly deployed MySQL cluster using the MySQL client
- Tested the cluster failover from the command line
- Queried the database, created tables and inserted records
- I ssh(ed) into both the VMs to ensure that MySQL replication was working as expected
- Wiped out the cluster after I was satisfied with the results!
I didn't have to install Putty or Cygwin nor did I have to enable HyperV and install Ubuntu or another Linux distro (flavour).
It's one of these times that I felt empowered to do what I need without having to jump through 20 hoops or rely on 3rd party, half-baked solutions. It's all about using the right tool for the right job! And for this instance, we have the Windows team to thank. Because they made the Linux subsystem part of the native Windows toolchain. And it looks like this:
If you haven't tried it yet, I urge you to give it a go and hopefully you'll feel as elated as I did today (apart from the fact that I suck in using bash/cmd/powershell).