Azure automation is a cloud based service which allows you to automate, configure and install updates across hybrid environments. Azure Automation focuses on an infrastructure perspective and allows you to build/deploy resources, handling updates and configuring all type of resources (not only in Azure but also on premise).
Coming from a development background and using mostly Azure PAAS components (Azure Functions, Web Apps, Web Jobs, etc..) I had not used it until recently when I got a request from the DBA team for setting up jobs to resolve index fragmentation by reorganizing and rebuilding index for which they suggested to use Azure Automation.
The core component in Azure Automation are runbooks which contain the automation code that you want to use to perform the automation task at hand. There are a number of runbook types: (textual) PowerShell runbook, graphical runbook, PowerShell workflow runbook and Python runbook
You can use the Azure Az PowerShell module to create an Azure runbook using the following steps:
- Create an Azure Automation Account with New-AzAutomationAccount
- Create the runbook with New-AzAutomationRunbook
- Import PowerShell code using Import-AzAutomationRunbook
- Publish runbook - before you can start using a runbook, you have to publish it - Publish-AzAutomationRunBook
- Create a schedule and associate it to the runbook - schedules can be shared by multiple runbooks - using New-AzAutomationSchedule and Register-AzAutomationSchedule
References:
- Introduction to Azure Automation (Microsoft Docs)
- View and understand Azure Automation job status
- Azure SQL - Index tables using Azure Automation and Manage databases in Azure SQL Database by using Azure Automation
- Azure Automation or DevOps - which is right for me?
No comments:
Post a Comment