Quick tip ! Azure Automation


Hello,

Want to save some money on your cloud infra ? Make sure to put it off when you’re not using it.

And now you have the ability to use some automation features for this.

Compare it to orchestrator here : http://msdn.microsoft.com/en-us/library/azure/dn643629.aspx

 

Log on to the azure management portal and open automation

 


 

Create an account

 


Fill in accountname and select region

 


Ok now we can create a new runbook . You can create one from scratch or use an existing runbook.

 


In this case we want to shut down the environment.

 

You can review the script presented.

 


And modify the name, account or subscription.

 


 

Ok now go to the runbook and modify the required parameters.

Use the author command.

 


 

Test the runbook

 


 

And verify the result

 

 


 

As you can see we need to create a connection Asset. So back to to the runbooks -> Assets.

Additional information about the assets can be found here http://azure.microsoft.com/blog/2014/07/29/getting-started-with-azure-automation-automation-assets-2/


And add a setting. Make sure to copy your subscription ID before starting the wizard !


 

Select a connection, Azure, give it a name.

 


And create a cert and paste your subscription id.

 

 

Now create a self signed certificate for uploading to Azure.

Use server 2012 R2 web services.

 

Open IIS -> Server certificates

 


 

Create a self signed certificate

 


 

Modify name and leave it in personal store

 

 

 

Click view details and copy to file

 


 

Export once as cer without private key.

 


And once as .pfx with the private key.

 


 

Now add the .cer file to Azure management certificates.

 


 

Now back to Azure Automation and create an additional credential asset.

 


 

Next up browse for your .pfx file and enter your password.

 


 

 

Now go to the runbook and modify the parameters using the author tool.

 


 

$MyConnection -> This your Automation connection created in the assets section

$MyCert = This is the name of the new imported credential in the assets section

 

Also correct the Azure subscription name hardcoded in the script.

 

 


 

Save , test and verify result.


 

Haleluja ! Success !

Now all we need to do is add a schedule and that’s it.

Publish.


 

Now create a new schedule

 


Name it.

 


In this case set to Friday , 19:00 each 7 days.

 


That’s it , imagine the possibilities.

 

Enjoy.

Gino D

Additional info can be found here : http://blogs.technet.com/b/keithmayer/archive/2014/04/04/step-by-step-getting-started-with-windows-azure-automation.aspx

 


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s