Use VCE Exam Simulator to open VCE files
This Chapter covers following Topic Lessons
This Chapter covers following Lab Exercises
In this chapter we will add Azure Automation to the Topology.
From Automation Dashboard we will configure Desired State Configuration. From Automation Dashboard we will also enable Update, Inventory and Change Tracking Management for Azure Virtual Machines.
Azure Automation is a managed service that provides process automation, configuration management, update management, Inventory Management and Change Tracking. It automates manual processes (Process Automation) and enforces configurations for physical and virtual computers (Desired State Configuration) and Update/Inventory/change tracking for Azure VMs or On-premises VMs or Physical Servers
Figure below shows the architecture of Azure Automation. Azure Automation provides it functionality to both Azure and on-premises resources.
Log analytics workspace is required if you want to offer Update Management, change & Inventory tracking functionality and Hybrid worker solution. It also collects Runbook job status and receives configuration information from your Automation account.
In Azure Portal click create a resource> Management Tools>Automation> Add Automation Account Blade opens>Enter a name, Select RGCloud in Resource Group and click create
Figure below shows Automation Account Dashboard.
From Automation Dashboard you can configure Desired State Configuration and Process Automation. From Automation Dashboard you can also enable Update, Inventory and Change Tracking Management for Azure Virtual Machines or on-premises servers.
Azure Process Automation automates manual processes using Runbooks against Azure Resources. Runbooks are containers for custom scripts and workflows. You can invoke and run runbooks on demand or according to schedule by using Automation Schedule assets or based on alerts in OMS Log Analytics.
Figure below shows Architecture of Process Automation.
Runbooks are created in Azure Automation Account and work against Azure Resources such as VMs, Azure SQL, Web Apps etc to automate manual process.
Runbooks can also run on-premises where-in you can install one or more Hybrid Runbook Workers in your data center which run runbooks against local resources. Each Hybrid Runbook Worker requires Microsoft Management Agent to be installed and an Automation account. The agent must have a connection to an Azure Log Analytics workspace.
You want your Azure VMs to run only during office hours only (8 AM - 5 PM). To save money an administrator shuts down VMs at 5 PM and ReStarts at 8 AM. Using Azure Process Automation you can Automate shutdown and re-start activity. You can use Azure Process Automation to create Runbooks (containing Powershell scripts) to shutdown VMs and Restart VMs which run against your Azure VMs at Schedule time daily.
Desired State Configuration (DSC) is a configuration management platform in Windows PowerShell that deploys and enforces the configuration on Windows VMs and Physical Servers.
PowerShell DSC configurations are PowerShell scripts that apply Desired Configurations to Windows VMs and Physical Servers. You can apply DSC to Azure VMs in following 2 ways:
Azure Automation provides a pull server in the cloud that manages DSC configurations which nodes can access to retrieve required configurations.
PowerShell DSC configurations are PowerShell scripts that apply Desired configurations to DSC Nodes from a DSC Pull Server in the Azure cloud. If DSC nodes deviate from there desired configuration then you can manually or automatically update desired machine configuration on DSC nodes.
Azure VMs require Desired State Configuration agent extension. It is automatically deployed to Azure VMs when you add them as DSC nodes in Automation Account Dashboard. Non Azure VMs & Servers require Powershell DSC agents.
The extension uploads and applies a PowerShell DSC Configuration on an Azure VM.
In this case node (Azure VM) is not centrally managed. DSC extension involves a singular action that occurs during deployment.
The other disadvantage of this approach is that you have to apply DSC Extension to each VM separately.
Important Note: DSC extension differs from Azure Automation DSC Service in a sense that this involves a singular action that occurs during deployment. No ongoing reporting or configuration management is available, other than locally in the VM.
Advantage 1 of Using DSC with Azure Automation is that you can apply configuration to Multiple nodes simultaneously.
Advantage 2 of Using DSC with Azure Automation is that if nodes drift from their configuration it is reapplied by DSC Pull Server.
In this exercise we will enable IIS Web Server role on VM VMAD using Desired State Configuration (DSC). Recall that VM VMAD was created with AD DS role in Chapter 2, Exercise 32.
Step 1: Create a PS script which ensures either the presence or absence of the Web-Server Windows Feature (IIS).
I created below PS script in notepad and saved it as TestConfig.ps1 on my desktop.
configuration TestConfig
{
Node IsWebServer
{
WindowsFeature IIS
{
Ensure = 'Present'
Name = 'Web-Server'
IncludeAllSubFeature = $true
}
}
Node NotWebServer
{
WindowsFeature IIS
{
Ensure = 'Absent'
Name = 'Web-Server'
}
}
}
Note: You can download the above script from following link at Box.com.
https://app.box.com/s/x2vskf3oo9aluiavm6bmqjjrcdvm8m9q
Step 2: Import the Configuration into Azure Automation
In Azure Automation aaportal Dashboard click State Configuration (DSC) in left pane> DSC pane opens.
Click Configuration in right pane>Click + Add>Import Configuration blade opens>Upload TestConfig.ps1 from your desktop. This was created in step 1> Click Ok (Not Shown).
You can now see the Configuration which was imported. If required press Refresh tab.
Step 3 Compile the Configuration
Click the Configuration TestConfig as shown in above screen>TestConfig Pane opens.
Click Compile>Compile DSC Configuration box pops up>Click Yes.
It will take 1-2 minutes to compile the job. You can see compiled configuration. If required press Refresh screen.
Step 4 View the Node Configurations which were compiled
In Azure Automation aaportal Dashboard click State Configuration (DSC) in left pane> DSC pane opens>Click Compiled Configurations in right pane> You can see the 2 configurations options. No Node is assigned.
Step 5 Assign the Node VM VMAD to DSC Pull Configuration Server
In Azure Automation AACloud Dashboard click State Configuration (DSC) in left pane> DSC pane opens>Click Nodes in right pane>Currently no node is assigned.
Click + Add>Select VMAD>Connect pane opens>Click + Connect> Registration pane opens>Select your Configuration from Drop down box> I selected TestConfig.IsWebServer >Rest Select all default values>Click Ok.
It will, take 2-5 minutes for Node to get connected.
In Nodes screen you can see 1 Node added and configuration status is showing in progress.
After 3-5 Minutes you can see node is compliant.
Step 6 Check that IIS Role has been installed in VM VMAD
Go to VMAD dashboard and note down the DNS address. DNS address is vmad.westus2.cloudapp.azure.com> Open Browser and enter vmad.westus2.cloudapp.azure.com> Default Website opens.
In this exercise we will just demonstrate on how to apply PowerShell DSC extension to Azure VM.
Go to VM VMFE1 dashboard>Click Extension in left pane>In Right pane click + Add> Add Extension blade opens>Select PowerShell Desired State Configuration> PowerShell Desired State Configuration blade opens in right pane.
In right pane click create> Install Extension Blade opens>Click folder icon and upload file for executing on VM VMFE1.
Disadvantage of this approach is that you have to apply PowerShell DSC extension to each Azure VM separately.
The Update Management solution in Azure automation allows you to manage operating system security updates for your Windows and Linux computers deployed in Azure, on-premises environments, or other cloud providers.
Update Management Functionality requires Log analytics workspace.
With update management, you will always know the compliance status for Windows and Linux machines and you can create scheduled deployments to orchestrate the installation of updates within a defined maintenance window.
This exercise will enable Update Management and add Azure VM VMFE2 for Assessment. After this is enabled you can see the missing updates. This step will not deploy the updates.
We will create a new Log Analytics for this Exercise.
You can enable Update Management through Automation Account Dashboard or through Virtual Machine Dashboard. For this exercise we will use Automation Account Dashboard.
In Azure Automation Account AACloud Dashboard click Update Management in left pane>In right pane under Log Analytics Workspace select Create new workspace>Click enable.
After Deployment is enabled refresh the screen with F5. Make sure Update Management is selected in left pane. Currently there are no machines for assessment.
Click + Add Azure VMs in Right Pane> Enable Update Management pane opens>Select VM VMFE2> Click enable.
Wait 25-30 minutes for Virtual Machine to appear on Update Management pane. Just refresh the screen with F5 continously with update Management selected in left pane. It took 35 minutes for below screen to appear.
In Figure below you can see one critical and security update and one other update is missing.
Click on Missing updates > you can see the updates which are missing.
In Update Management pane click schedule update deployment>New update Deployment pane opens>Enter a name> click Machine to update>In Right pane select Machines from Type dropdown box>Make sure VM VMFE2 appears under Machines >Click VM VMFE2 and it now also appears under selected items>Click Ok in right pane>In left pane in schedule settings select the start time and Recurrence as Once or Recurring and click ok>Click Create.
Note : Readers are advised to check options in update classification pane. Also scroll down to see all the options.
Click on Deployment Schedules and you can see one deployment Job created in step 1 is scheduled for 5.04 PM.
In figure below shows 1 update was applied and 1 update failed. This step I did after scheduled deployment happened.
Enabling inventory of your VMs in Azure Automation gives you visibility into installed applications as well as other configuration items you wish to track. Rich reporting and search is available to quickly find detailed information to help understand everything that is configured within the VM.
Change tracking tracks changes across services, software, registry, daemons, and files to quickly identify what might be causing issues and to enable diagnostics and alerting when unwanted changes occur.
Note: When you enable Inventory for a VM then change tracking is also enabled automatically.
In Azure Automation Account AACloud Dashboard click Inventory in left pane> In Right pane select Log Analytics workspace created in Exercise 170>Click enable
After Deployment is enabled refresh the screen with F5. Make sure Inventory is selected in left pane.
Click Add Azure VMs in Right pane>Enable Inventory Blade opens>Check the VM VMFE2>Click enable> Close the enable inventory pane
After 30-40 minutes VM VMFE2 appeared in inventory pane. Keep on refreshing Automation Account Dashboard with inventory selected.
Click on the software tab in right pane> You can see software installed in last 24 hours.
In Azure Automation Account AACloud Dashboard click Change tracking in left pane> In Right pane you can see changes which have occurred in Azure VM VMFE2.
Top Training Courses
LIMITED OFFER: GET 30% Discount
This is ONE TIME OFFER
A confirmation link will be sent to this email address to verify your login. *We value your privacy. We will not rent or sell your email address.
Download Free Demo of VCE Exam Simulator
Experience Avanset VCE Exam Simulator for yourself.
Simply submit your e-mail address below to get started with our interactive software demo of your free trial.