Azure Automation

Nowadays, we are well familiar with the word Automation. Whether it is for providing value to customers or using robotics techniques for getting improvement in the areas of IT, automation is providing benefits to many organizations. And, in this race how can Microsoft let itself left behind. That is to say, Microsoft came up with Azure Automation. 

Azure automation is for automating, configuring, and installing updates across hybrid environments. But, it is capable of this only? The answer is no. In this blog, we will learn about core areas of Azure Automation and methods you can use to quickly get started with it.

What is Azure Automation?

Azure Automation is used for performing cloud-based automation and configuration service for supporting compatible management across Azure and non-Azure environments. Moreover, it contains various components like process automation, configuration management, update management, shared capabilities, and heterogeneous features. Further, automation provides full control during the process of deployment, operations, and decommissioning of workloads and resources.

Azure automation components

Components:

1. Process Automation

Process Automation is for automating constant, time-consuming, and error-prone cloud management tasks. This service helps you in focusing on work that adds business value. 

Further, process automation supports the integration of Azure services and other public systems needed for deploying, configuring, and managing your end-to-end processes. Lastly, the service allows you to write runbooks graphically, in PowerShell or using Python. 

2. Configuration Management

Configuration Management in Azure Automation allows two features:

Change Tracking and Inventory

  • Change Tracking and Inventory merge change tracking and inventory functions for tracking virtual machine and server infrastructure changes. The service supports change tracking across services, daemons, software, registry, and files in your environment for helping in diagnosing unwanted changes and raise alerts. And, inventory support is for querying in-guest resources for visibility into installed applications and other configuration items. 

Azure Automation State Configuration

  • Azure Automation State Configuration refers to a cloud-based feature for PowerShell desired state configuration (DSC). This provides services for enterprise environments. Moreover, using this you can manage your DSC resources in Azure Automation. And, further, apply configurations to virtual or physical machines from a DSC pull server in the Azure cloud.
3. Update management

Update Management feature in Azure Automation is for Windows and Linux systems across hybrid environments. This provides visibility into update compliance across Azure and other clouds and on-premises. Moreover, the feature helps in creating scheduled deployments that orchestrate the installation of updates within a defined maintenance window. 

4. Shared capabilities

Azure Automation offers a number of shared capabilities. This includes: 

Shared resources

Azure Automation consists of shared resources used for automating and configuring environments at scale.

  • Firstly, schedules for triggering Automation operations at predefined times.
  • Secondly, modules for Managing Azure and other systems. 
  • Thirdly, the modules gallery for supporting native integration with the PowerShell Gallery for viewing runbooks and import them into the Automation account. 
  • Then, python 2 packages for supporting Python 2 runbooks for your Automation account.
  • Next, credentials for securely storing sensitive information that runbooks and configurations can use at runtime.
  • After that, connections for storing name-value pairs of common information for connections to systems. 
  • Then, certificates for defining information used in authentication and securing deployed resources during runtime.
  • Lastly, variables are for holding content which can be used across runbooks and configurations. However, you can change variable values without having to modify any of the runbooks or configurations that reference them.

Role-based access control

  • Azure Automation supports Azure role-based access control for regulating access to the Automation account and its resources..

Source control integration

  • Azure Automation includes source control integration for promoting configuration as code where runbooks or configurations can be checked into a source control system.
5. Heterogeneous support (Windows and Linux)

Automation is designed for working over a hybrid cloud environment and for Windows and Linux systems. Moreover, it has the ability to deliver a consistent way for automating and configuring deployed workloads and the operating systems that run them.

secure and safe

Azure Automation: Features

  • Firstly, Azure Automation has the ability to automate all frequent, time-consuming, and error-prone cloud management tasks. Moreover, it let you focus on work which adds business value by reducing errors and boosting efficiency.
  • Secondly, for Windows and Linux, it monitors update compliance over Azure, on-premises, and other cloud platforms. Further, it schedules deployments for orchestrating the installation of updates within a defined maintenance window.
  • Thirdly, in the cloud, it creates and manage PowerShell configurations, import configuration scripts and generate node configurations. However, for monitoring and automatically updating machine configuration over physical and virtual machines in the cloud or on-premises Azure Configuration Management is used.
  • Then, it helps in getting an inventory of operating system resources including installed applications and other configuration items. Moreover, it tracks changes across services, daemons, software, registry, and turns on diagnostics, and alerting for monitoring unwanted changes.
  • Amazon Automation can write runbooks graphically in PowerShell or Python for integrating Azure services and other public systems needed for deploying, configuring, and managing your end-to-end processes. 
  • Lastly, it depends on serverless runbooks to grow automatically as your operational tasks increase. Moreover, it delivers services more quickly and consistently by focusing on adding a business.

Azure Automation: Products & services

The products and services that use Azure Automation include:

azure automation products
1. Azure Monitor

The Azure monitor is used for collecting, analyzing, and acting on measured data from your Azure and on-premises environments. Further, it helps in maximizing the performance and availability of your applications.

Features:

  • Firstly, it provides everything necessary for monitoring the availability, performance, and usage of your web applications. Azure Monitor supports popular languages and frameworks which include .NET, Java, and Node.js. Moreover, it also integrates with DevOps processes and tools like Azure DevOps, Jira, and PagerDuty.
  • Secondly, it helps in analyzing and optimize the performance of your infrastructure, including virtual machines (VMs), Azure Kubernetes Service (AKS), Azure Storage, and databases. 
  • Lastly, it has the ability to monitor and diagnose networking issues without logging into your virtual machines. 
2. Azure Backup

Azure Backup refers to a cost-effective, secure, one-click backup solution that is scalable depending on backup storage requirements. It has a centralized management interface that is used for defining backup policies and protects a wide range of enterprise workloads. The workloads include Azure Virtual Machines, SQL and SAP databases and Azure file shares.

Features:

  • Firstly, it can manage your entire backup estate from a central console using Backup Centre. And, using Azure Automanage, it can automatically configure the Azure Backup on production virtual machines.
  • Secondly, it helps in protecting against ransomware by enabling multifactor authentication using a security PIN generated in the Azure portal. Moreover, it ensures recovery of items with no data loss for up to 14 days after an unauthorized deletion by enabling soft delete.
  • Thirdly, Azure Backup simplifies workload protection with built-in backup capabilities and saves time with one-click backup support for VMs, Azure file shares, SQL and SAP HANA databases, and Azure Database for PostgreSQL.
  • Lastly,  it removes the need for tape or offsite backup and provides cost-effective short- and long-term retention of backup data.

Above we have understood the basic overview of Azure Automation including its features, components, and services. From here, we will learn about steps to get started with Azure Automation. Starting with creating an account.

Creating an Azure Automation account

You can create an Azure Automation account using the Azure portal. This a browser-based user interface allowing access to a number of resources. However, you must know that one Automation account can manage resources over all regions and subscriptions for a given holder.

  • Firstly, sign in to Azure. Then, choose a name for your Azure account. However, automation account names are unique per region and resource group. 
  • Secondly, click the Create a resource button found in the upper left corner of the Azure portal.
  • Thirdly, select IT & Management Tools. After that, select Automation.
  • Fourthly, enter the account information, including the selected account name. For Create Azure Run As account, choose Yes so that the artifacts for simplifying authentication to Azure are enabled automatically. After adding the information, click Create to start the Automation account deployment.
  • After that, when the deployment is done, click All Services.
  • Lastly, select Automation Accounts. From there, choose the Automation account you created.

Above, we have created an Azure Automation account now, it’s time to create an Azure Automation runbook. But, before moving on, let’s take a look at runbook types to get an understanding of this.

Azure Automation Runbook Types

The Azure Automation Process Automation feature have various types of runbooks. They are:

1. Graphical runbooks

Graphical editor in the Azure portal is used for creating and editing graphical and graphical PowerShell Workflow runbooks. It can develop PowerShell code and during import, it can be transformed to or from graphical PowerShell Workflow runbooks.

Advantages:

  • Firstly, uses a visual insert-link-configuration authoring model.
  • Secondly, focusing on how data flows through the process.
  • Thirdly, visually represent management processes.
  • Lastly, includes other runbooks as child runbooks for creating high-level workflows.
2. PowerShell runbooks

PowerShell runbooks are based on Windows PowerShell in which you can directly edit the code of the runbook using the text editor in the Azure portal. 

Advantages:

  • Firstly, implement all complex logic with PowerShell code without the other complexities of PowerShell Workflow.
  • Secondly, works faster than PowerShell Workflow runbooks.
  • Lastly, it can run in Azure and on Hybrid Runbook Workers.
3. PowerShell Workflow runbooks

PowerShell Workflow runbooks refer to a text runbook based on Windows PowerShell Workflow. This is for editing the code of the runbook using the text editor in the Azure portal. 

Advantages:

  • Firstly, implementing complex logic with PowerShell Workflow code.
  • Secondly, use checkpoints for resuming operation if there’s an error.
  • Thirdly, use parallel processing for doing multiple actions in parallel.
  • Lastly, include other graphical runbooks and PowerShell Workflow runbooks as child runbooks for creating high-level workflows.
4. Python runbooks

Python runbooks are arranged under Python 2 and Python 3. However, this allows for directly editing the code of the runbook using the text editor in the Azure portal. 

Advantages:

  • Firstly, use the robust Python libraries.
  • Secondly, can run in Azure or on Hybrid Runbook Workers.
  • Thirdly, Windows Hybrid Runbook Workers are supported with python 2.7 installed for Python 2.
  • Next, Python 3.8 version is supported for Python 3 Cloud Jobs. However, if the code is compatible across different versions then, scripts and packages from any 3.x version might work.
  • You can choose to install any 3.x version for Python 3 Hybrid jobs on Windows machines.
  • Then, for Python 3 Hybrid jobs on Linux machines, we rely on the Python 3 version installed on the machine to run DSC OMSConfig and the Linux Lastly, Hybrid Worker. We recommend installing 3.6 on Linux machines. 

Creating an Azure Automation runbook

Azure Automation runbooks can be created using Azure. That is to say, this method provides a browser-based user interface for creating Automation runbooks

1. Create the runbook
  • Firstly, open your Automation account. Then, click Runbooks under Process Automation. After that, a list of runbooks will display.
  • Secondly, click Create a runbook at the top of the list.
  • Thirdly, for the runbook name, enter Hello-World in the Name field. Then, select PowerShell for the Runbook field type.
Enter information about your Automation runbook in the page
Image Source: Microsoft
  • After that, click Create. Now, the runbook is created and the Edit PowerShell Runbook page will open.
  • Next, copy and paste the following code into the edit pane. This will create an optional input parameter called Name with a default value of World. And it will outputs a string that uses this input value:

PowerShell

param

(

    [Parameter(Mandatory=$false)]

    [String] $Name = “World”

)

“Hello $Name!”

Screenshot of the Edit PowerShell Runbook page with a code example in the right window.
Image Source: Microsoft
  • Lastly, click Save for saving a draft copy of the runbook.
2. Testing the runbook

After creating the runbook, you must test the runbook for validating if it works.

  • Firstly, click the Test pane for opening the Test pane.
  • Secondly, enter a value for Name, and click Start. Now, the test job starts, and the job status and output display.
Screenshot of the Test pane with an example value in the name field.
Image Source: Microsoft
  • Thirdly, close the Test pane by clicking the X in the upper right corner. Then, select OK in the popup that appears.
  • Lastly, on the Edit PowerShell Runbook page, click Publish for publishing the runbook as the official version of the runbook in the account.
3. Running the runbook

Now, the runbook is published and it will display the overview page.

  • Firstly, on the runbook overview page, click Start for opening the Start Runbook configuration page for this runbook.
  • Secondly, leave the Name blank, so that the default value is used. And, then, click OK. Now, the job page will appear as the runbook job is submitted.
Screenshot of Job page showing the Output button selected.
Image Source: Microsoft
  • Lastly, when the job status is Running or Completed, click Output for opening the Output pane and viewing the runbook output.
4. Import a runbook

For making your own runbook, you can import a PowerShell or PowerShell Workflow (.ps1) script, a graphical runbook, or a Python 2 or Python 3 script (.py). However, specify the type of runbook created during import by checking the following considerations.

  • Firstly, you can import a .ps1 file with no workflow in either a PowerShell runbook or a PowerShell Workflow runbook. However, if you import it into a PowerShell Workflow runbook, it is converted to a workflow. 
  • Secondly, you can import only a .ps1 file containing a PowerShell Workflow into a PowerShell Workflow runbook. However, if the file contains multiple PowerShell workflows, the import fails. 
  • Thirdly do not import a .ps1 file having a PowerShell Workflow into a PowerShell runbook. For this case, the PowerShell script engine will not recognize it.
  • Lastly, only import a .graphrunbook file into a new graphical runbook.

Automation pricing

Azure Automation pricing comes with various options which include:

1. Process automation

  • Process automation consists of runbook jobs and watchers. However, billing for jobs depends on the number of job run time minutes used in the month. On the other hand, for watchers, it depends on the number of hours used in a month. Further, charges for process automation are collected whenever a job or watcher runs.

Free units included (per month)**
Price
Job run time500 minutes₹0.145/minute
Watchers744 hours₹0.145/hour
Source: Microsoft

2. Configuration management

  • Configuration management consists of the configuration pull service and change tracking abilities. Billing in this depends on the number of nodes registered with the service. And, also on the log data stored in the Azure Log Analytics service.
    • However, after the node is registered with the service, the charges for configuration management will start. And, it stops when the node is unregistered. 

Free units included (per month)**
Price
Azure nodeN/AFree
Non-Azure node5 nodes₹432.2716/node
Source: Microsoft

3. Update management

  • Update management consists of the visibility and deployment of updates in your environment. However, there are no charges for the services. So, you only pay for log data stored in the Azure Log Analytics service.

Free units included (per month)**
Price
Any nodeN/AFree
Source: Microsoft
Microsoft azure professional

Final Words

From the above article, we understood that Azure Automation is best for saving time, reducing errors, and increasing efficiency with managing cost. Understanding this service will help you in automating all your frequent, time-consuming, and error-prone IT management tasks, in the cloud or on-premises. Moreover, this will let you focus on work that adds business value. So, go through the article and learn how Azure Automation provides capabilities for process automation, update management, track changes and collect inventory using the reference links. Keep reading and stay updated!

Menu