Running Python 2.7 scripts in Azure Automation

I noticed a great new piece of preview functionality is now available in Azure Automation – you now have the ability to run Python 2 scripts!

The timing on this being available was a great one for me personally as one of my IaaS VM’s ceased to exist today and that VM was the one which was gathering my SolarCity data. Transferring this script was simple. I started by creating a new runbook of the type “Python 2 (Preview)”.

I cut and pasted the script (after changing the required variables in the script). Saved it, published it and it ran like a champ!

The next step was to create a schedule in the Azure Automation account which would run this script on an hourly basis.

And link you link schedule to the script. The jobs run just like regular PowerShell ones as shown below with the first run-through which completed successfully.

Summary: Looking for a quick and easy way to run your Python 2.x script? Check out the Automation Accounts functionality in Azure!

Leave a Reply