A spot of Python in your Azure automation? Step right this way, sir

Python 2 support for runbooks slithers out of preview

Microsoft this week announced something that may have surprised a few devs who'd seen it lurking in Azure for a while – Python 2 support has finally moved out of preview for Azure runbooks.

A runbook is a sequence of operations to automate a routine job. Examples would be managing resources or restarting VMs. Some can be fiendishly complex.

Azure has enjoyed a graphical editor in its portal to create workflows of operations for a while, although many users find themselves dropping into PowerShell when things get complicated. Hardcore admins dispense with the visual interface altogether and string together scripts of Windows PowerShell.

Obviously, users need to be familiar with PowerShell to make best use of runbooks or Workflow runbooks (and understand the difference between the two). A PowerShell runbook, for example, cannot perform multiple actions in parallel and, er, may struggle a bit during a Get-Process loop after about 80 iterations.

A PowerShell Workflow runbook, on the other hand, can use parallel processing, but is a bit more complex to put together and can be slower to start because it requires compilation before it can run.

The new, caring Microsoft does not want to force users to have to learn PowerShell (although we'd suggest it wouldn't hurt), hence the support for Python 2. Python 3, alas, is not supported and trying to use one of the latest and greatest functions will fail.

We fired up our Azure portal and, after jumping into Runbooks (and noting the disappearance of the Preview tag from the Python runbook type), were quickly dumping out the text "Hello World" to the output window. Adding variables (entered as input parameters) presented no issue, although we're not sure how many admins would use the inbuilt Azure text editor for anything more than basic editing.

The arrival of Python in Azure automation is clearly a good thing, although obviously it doesn't save the user from needing a good working knowledge of Azure's API. From Microsoft's perspective, adding support means that users with a toolbox full of Python have one less barrier to Azure adoption. ®

Biting the hand that feeds IT © 1998–2018