Compartir a través de


Step-by-Step: Get Ready to use Microsoft Azure Automation

Hello Folks,

For a long time now IT Operations has needed to be aligned application lifecycle and work closely and collaboratively to eliminate inefficiency, reduce bottlenecks, and maximize productivity.The concept is certainly not new, for a long time now business processes and operations based on software engineering concepts or lifecycle management methodologies are all trying to minimize inefficiency and maximize productivity. One clear way to do just that is to automate everything you can. In addition to efficiency and maximized productivity, you will also improve consistency, repeatability, and predictability.

Azure Automation allows you to automate the creation, deployment, monitoring, and maintenance of resources in your Azure environment using a highly scalable and reliable workflow execution engine. Orchestrate time-consuming and frequently repeated tasks across Azure and third-party systems to decrease time to value for your cloud operations

Azure Automation ships out of box with integration into many Azure services, including:

  • Web Sites (management)
  • Cloud Services (management)
  • Virtual Machines (management and WinRM support)
  • Storage (management)
  • SQL Server (management and SQL support)

But how do you get ready to use or write your own Run Book? The next few step will take you through the setup of the Microsoft Azure Automation.

1.Log in to the Azure Management Portal.

2.In the Management Portal, select Automation on the left, and click Create an Automation Account

image

3. Fill out the dialogue box with the name of the account you want to create

image

4- you now have a automation account ready to be used to automate your tasks.

image

Before running a runbook, make sure the following components are available:

  • Automation Certificate Asset containing the management certificate loaded to Azure
  • Automation Connection Asset containing the subscription id and the name of the certificate setting in Automation Assets
Management Certificates

When you access the Microsoft Azure Portal, you have authenticated using an Office 365 or Microsoft account. But when you are using code, scripts, or other automation process to make a call to the Azure Management API, the requests must be signed by a X509 certificate. These certificates that are used to sign the requests are referred to as Management Certificates and you can create them manually or download one from the portal.

Download, Install and Configure the Microsoft Azure PowerShell Management Tools

In addition to managing Microsoft Azure via the web-based Management Portal, Microsoft also provides a Microsoft Azure PowerShell module for scripted management of Microsoft Azure services. Both the Management Portal and PowerShell will be used in this series, requiring installation and configuration off the Microsoft Azure PowerShell cmdlets to get prepared.

  1. Download and Install the Microsoft Azure PowerShell cmdlets. Note that a restart may be required after installing this module.
  2. Right-click on Windows PowerShell in your Start Menu or Start Screen and choose Run As Administrator.
  3. Import the Microsoft Azure PowerShell module and supporting cmdlets by running the following command at the PowerShell command prompt:
         PS C:\> Import-Module Azure
  4. Download and save your Microsoft Azure Publish Settings file by running the following command at the PowerShell command prompt:
         PS C:\> Get-AzurePublishSettingsFile
  5. Import the saved Microsoft Azure Publish Settings file by running the following command at the PowerShell command prompt:
         PS C:\> Import-AzurePublishSettingsFile "full_path_to_saved_file.publishsettings"

The following screen shot shows the results. Please note the name and subscription ID. you’ll need them later.

image

Automation Certificate Asset

The Assets page in Microsoft Azure Automation displays the various resources that are globally available to be used in or associated with runbooks, plus commands to import an integration module, add a new setting, or delete a setting. Settings include variables, schedules, credentials, and connections. Connections are defined in integration modules, and because of that they do not have a fixed format.

1- to setup the Automate Certificate Asset I first installed the Windows SDK for Windows 8 to create my own self-signed management certificates using the following command:

makecert -sky exchange -r -n "CN=Azure-Management" -pe -a sha1 -len 2048 -ss My "Azure-man.cer"

image

2- Now that I have the certificate ready. In the Automation pane, select Asset, and in the action bar at the bottom. click “Add Setting”

image

3- Fill out the info in the dialogue box, and click the right-arrow at the bottom.

image

4- Select the certificate you created earlier and upload it.

image

Automation Connection Asset

Next, we need to create a connection setting that point to the management certificate that is in the we configured in the “Management Certificates” section above.

1- In the Automation pane, select Asset, and in the action bar at the bottom. click “Add Setting”

image

2- Fill out the info in the dialogue box, and click the right-arrow at the bottom.

image

3- enter the Certificate name and subscription ID that you noted earlier in the settings-Management Certificate section.

image

image

4- Once this is done you are now ready to explore all the benefits that Azure automation can bring you.

Next time we use this setup to automate some process.

 

Until then, you can review the following MVA modules.

Cheers!

clip_image011

Pierre Roman | Technology Evangelist
Twitter | Facebook | LinkedIn