# A Deeper Blue

I’ve had an Azure subscription for a while, but now that I got an opportunity to go (much) deeper into it, I thought I’d jot down a few public notes and at least one useful tip before my disclaimer kicks in.

The short of it (putting the business issues aside) is that I’m looking into orchestration, much like what I did with AWS a few years back. It’s a nice step up from a little dip into GAE earlier this year and the configuration management stuff I do for my projects at work, and doing it in regular office hours makes it all the more fun, and appeals to my methodical take on all things related to infrastructure.

I’m hesitant to go about calling this “devops”, however, both because it feels like a pointless moniker when you’ve moonlighted as a sysadmin for as long as I have, and also because it all really boils down to laziness – the best way to make sure you’ll get reliable, repeatable setups is to automate everything away, and that is what saves you time, worries – and money.

As usual these days, there are entirely too many options to orchestrate stuff in the cloud1 but for the requirements I’m capturing, using something like Ansible feels like cheating, so I went down a couple of abstraction layers – i.e., straight to the API. Even though I’ve written mostly Go and Clojure(-y) stuff over the past couple of months, Microsoft’s Azure SDK for Python was the natural thing to reach for.

So far, it seems more than adequate for rolling your own orchestration – it took me only an hour or so to read through it and get an instance going from basic principles, and bpython makes for an excellent ad-hoc CLI once you’ve familiarized yourself with the naming2:

So that’s my pro tip, right there – the Python SDK with a REPL going. It’s not PowerShell, but it’s much better for me given that after setting up a few wrappers you can do wonderful stuff like setting up (or tearing down) entire flocks of machine instances in a nice functional style:

>>> map(utils.shutdown, deployment.role_instance_list.role_instances)
[u'Stopped',u'Stopped',u'Stopped',u'Stopped',u'Stopped',u'Stopped',u'Stopped',u'Stopped',u'Stopped',u'Stopped']


To be honest, once you’re on a roll it feels a little like this:

…and then you remember you still need to nail down a lot of details and wrap the whole thing in an ansychronous daemon that implements a bunch of “boring” business logic.

Ah well.

1. Gosh, how I hate the overuse of the word “cloud”, and all the “as a service” acronyms. Still, it’s a good thing people don’t call them “sausage factories” or something like that – can you imagine having SFAAS all over your product slides? ↩︎

2. To be honest, the thing’s naming is more than a tad inconsistent and the API isn’t very Pythonic, but it does the job. ↩︎