Azure Automation is a cloud solution that aids corporations meet up with their infrastructure and protection needs by automating jobs, providing preferred condition configuration for your servers, and configuration management. By default, when Azure Automation is developed it will allow execution of scripts in Azure. But some corporations want to be equipped to automate jobs in other clouds and on-premises environments, and the Hybrid Worker tool is the important to supply these kinds of solution.
The Hybrid Runbook Worker Group is a set of one particular or a lot more VMs configured to act as Hybrid Runbook Worker. Servers configured with this part question the Azure Automation cloud provider by port 443 to check if there is any position accessible. If there is a position, then the Hybrid Worker will execute the runbook.
When working with Hybrid Worker, the scripts will be executed on those people VMs and we will have to make guaranteed that future Runbooks have all items of software package accessible, such as Azure Modules. If we have a lot more than one particular server, we will have to make guaranteed that they are configured constantly.
Building the Azure Automation account
The first phase in this report is to create the Azure Automation account, and that account will be liable to operate our script on an interval basis. Logged on to Microsoft Azure Portal, simply click on Build a source, style in automation and select Automation. In the new blade simply click on Build.
Make guaranteed to select Sure in the Build Azure Run As account industry. Mainly, that will create a Assistance Principal in your Azure Energetic Directory.
Note: If you want to discover out the Assistance Principal identify developed throughout this system, after the development system, simply click on the Automation Account, and then simply click on Run as accounts merchandise on the left side of the blade. Click on the preferred Run As account. In the new blade the Azure Energetic Directory Software industry will have the identify which this account was registered.
The subsequent phase is to create a new Log Analytics source. Mainly, we need to have to define a exclusive identify, source team, and area.
After generating the new workspace, open the OMS portal by selecting the Log Analytics merchandise in the Useful resource Group that you defined throughout the development of the source. In the most important website page (OMS Workspace), simply click on OMS Portal, and a new website page with OMS most important website page will be displayed. Click on the Shop icon, and then simply click on Automation & Regulate, and then simply click on Configure Workspace.
In the new website page, select the Automation Account that we have just developed and simply click on Alright.
Note: To check if any specified OMS has an Automation Account, simply click on Configurations, Accounts, and then Automation Account.
Building and configuring Hybrid Worker
The Hybrid Worker is a typical Home windows Server 2016 VM that we provisioned working with Azure Portal working with default values, and all Azure Automation scripts that are configured to operate on Hybrid Worker manner will be executed on this virtual machine.
After provisioning the server, our first phase is to put in the script that results in the integration concerning the VM and the Azure Automation Account. To put in it, operate the adhering to PowerShell cmdlet. The system will configure the latest server to assistance all the needs to down load and put in the preferred script.
Put in-Script -Title New-OnPremiseHybridWorker
The subsequent phase is to operate the PowerShell script underneath. As you can see, there is some facts that we need to have to present. Before functioning the script to put in the Hybrid Worker, we need to operate these adhering to cmdlets to retrieve all demanded facts:
The higher than cmdlet provides values for these adhering to parameters: WorkspaceName and OMSResourceGroupName.
The higher than cmdlet provides values for AutomationAccountName and AAREsourceGroupName
The higher than cmdlet provides the worth for the SubscriptionID parameter
Getting all those people values completely ready aids when functioning the cmdlet underneath. The only parameter lacking is the HybridGroupName and we will define it throughout the execution of the cmdlet. In our report we are going to use HybGroup01. The script will get some time to execute, and it will have to have authentication. Modules will be mounted and loaded, and the Microsoft Monitoring Agent will be mounted as perfectly.
The outcome of a thriving operate will be very similar to the image higher than, the place the last phase is the registration of the Hybrid Runbook Worker in Microsoft Azure. We can check in the Azure side to see the improvements executed by the script. Click on the Automation Account and then simply click on Hybrid Worker teams, and in the Consumer Hybrid Worker Groups, we will have a new entry as depicted in the image underneath.
Now that we have the Hybrid Worker teams in place, we can select the place we want to operate the preferred Runbook. We can select Azure or Hybrid Worker.
Logged on the Azure Portal, select the Automation Account and then simply click on Runbooks, select a Runbook from the record or create a new one particular. After owning the preferred Runbook staying detailed on the appropriate side, simply click on Start off. In the new blade, select Hybrid Worker and select the team. In our report we have only the one particular that we have just developed.
These are the basic steps to get the Hybrid Worker configured. In future articles or blog posts here at TechGenix, we will be checking out a lot more options accessible in Azure Automation. Remain tuned!
Showcased image: Shutterstock