Tag Archives: sma

Working with schedules in Azure Automation (and SMA)

The few of us that have started working with Azure Automation and/or SMA have probably noticed the lack of functionality that would equal a monitoring activity in Orchestrator.

I’ve seen some solutions which consist of a Runbook being set in an infinite loop with a sleep timer at the bottom.
In practice this method would replicated the desired functionality, that is, until the Runbook hits the maximum runtime value and kills the process. If you’re using Azure Automation this would also mean that you’ll be consuming Automation Minutes. 24/7.

What you’ll want to do with Azure Automation and SMA is to work with schedules to mimic a monitoring activity. And this can be a hassle to manage… Unless you’re using the right tools! 🙂
(Hint: Powershell.)

First we’ll want to create the required schedules. In 99% of the cases I work with hourly schedules at different minute intervals and I create them with the following script found at Technet Gallery.

If you use the “-Verbose” parameter you’ll get output on the schedule creation process.

And lastly we’ll want to assign Runbooks to the required schedules so the Runbook executes at the right time with the following script:

By piping to “Out-Gridview -Passthru” I can easily filter all the schedules and select the ones I want. Oh, and they script writes the intervals into the Description property of the schedules. This makes life a bit easier if you want the Runbook to execute, for example, every 5 minutes.

AaSchedules

The result would look something like this in the Azure Management Portal:

AaSetSchedules

I hope this helps you to manage your Automation Runbooks in a more efficient way and lower your Azure bill!

Again, the script can be found at: https://gallery.technet.microsoft.com/Generate-Azure-Automation-1dab9193

Powershell User Group Sweden – October 2013 Meeting!

As promised during my session at the Powershell User Group Sweden meet last week I will publish my scripts used in my SMA session. And here they are!

For those of you not attending the meet I had the opportunity to give a super compact lesson in Powershell Workflow to cover the basics. Workflows are after all the foundation of SMA. I gave the attendees an overview of SMA administration. Both in powershell/ISE and the Windows Azure Pack portal!

smaportal

Continue reading

What’s the deal with the Runbooks?

Yup, there’s a difference between runbooks and runbooks. Thank you Microsoft for making it easy for us! Let me break it down for you.

On the Orchestrator’s TechNet page we can find the following text:

Topics include how to write, test, and deploy a runbook with System Center 2012 – Orchestrator.

And on the Service Management Automation (SMA) page we can find this:

You automate your tasks by using runbooks, which run Windows PowerShell commands.

So, same name on two different products. With a tiny little difference thanks to the keyword “PowerShell”. Where Orchestrator runbooks are based on activities, the SMA runbooks are completly based on Powershell. Or to be more specific Powershell workflows.

But is it really two different products? Continue reading