Skip main navigation

Automating Processes with Runbooks

.

At this point in the course, you are familiar with DevOps and Infrastructure as Code, you understand what Azure Automation is and you can create Automation Accounts and set up Automation Security.

In this step, we’ll explore runbooks and what runbooks can automate.

What is a Runbook?

Runbooks deliver the core functionality of Azure Automation by serving as repositories for your custom scripts and workflows. In addition, runbooks typically reference Automation assets such as credentials, variables, connections, and certificates. They can also contain other runbooks, thereby allowing you to build more complex workflows. You can invoke and run runbooks either on-demand or according to your chosen schedule by leveraging Automation Schedule assets.

Simply put, a runbook is a set of tasks that perform some automated process in Azure Automation. It may be a simple process, such as starting a virtual machine and creating a log entry, or you might have a complex runbook that combines other smaller runbooks to perform a complex process across multiple resources, or even multiple clouds and on-premises environments.

Traditionally, runbooks were a list of instructions that needed to be followed to complete an activity. Any activity that became a recurring task would usually end up with a runbook to reduce dependencies on specific individuals.

A common use case for a runbook could be this: You might have an existing manual process for truncating a SQL Azure database if it’s approaching maximum size. That process includes multiple steps such as connecting to the server, connecting to the database, getting the current size of the database, checking if the threshold has exceeded and then truncating it, and notifying the user.

Instead of manually performing each of these steps, you could create a runbook that would perform these tasks as a single process. You would start the runbook, provide the required information such as the SQL server name, database name, and recipient email, and then sit back while the process completes.

What can Runbooks Automate?

Runbooks in Microsoft Azure Automation are based on Windows PowerShell or Windows PowerShell Workflow. They do anything that PowerShell can do. If an application or service has an API, then a runbook can work with it. If you have a PowerShell module for the application, you can load that module into Azure Automation and include those cmdlets in your runbook.

Azure Automation runbooks run in the Azure cloud and are capable of accessing any cloud resources or external resources that can be accessed from the cloud. Using Hybrid Runbook Worker, runbooks can run in your local datacentre to manage local resources. The runbooks are stored and managed in Azure Automation and then delivered to one or more on-premises machines. Azure runbooks can also automate the provisioning of a virtual machine in Amazon Web Services (AWS).

Join the discussion

Can you think of an example where you would need to create a runbook? Share your example with us.
Use the Discussion section below and let us know your thoughts. Try to respond to at least one other post and once you’re happy with your contribution, click the Mark as complete button to move on to the next step.
This article is from the free online

Microsoft Future Ready: DevOps Development, Implementation and Azure Automation

Created by
FutureLearn - Learning For Life

Our purpose is to transform access to education.

We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.

We believe learning should be an enjoyable, social experience, so our courses offer the opportunity to discuss what you’re learning with others as you go, helping you make fresh discoveries and form new ideas.
You can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.

Learn more about how FutureLearn is transforming access to education