Skip main navigation

New offer! Get 30% off one whole year of Unlimited learning. Subscribe for just £249.99 £174.99. New subscribers only. T&Cs apply

Find out more

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

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now