Automation–Automating Hybrid Clouds with Windows Azure and PowerShell (Part 1): Introduction and Table of Contents

Hello Readers and Viewers!

By now, you have likely seen Brad Anderson’s Blog Post (VMware Migration… Like You’ve Never Seen) and its associated video, starring Building Cloud Blog’s very own Migration Mark! And sure, I have a cameo, but let’s be honest, that movie is all about The Migrator and the amazing MAT (powered by Project Shift) .


So why do I bring it up? Well, at the 04:03 timestamp, I bravely profess, “Extending your migration to Windows Azure is easy. It’s like 5 more lines of PowerShell…(elevator music while sped up demo plays)…actually, it’s like magic.”

And while it may not be EXACTLY like magic, it is possible. That is what this blog series is all about.

First, a message from its predecessor

I do want to pause briefly to call-out that this is not the first time we have seen this kind of fancy-chocolate-rainbow-filled-magic in the wild. No, it was first introduced (at least by me, I am sure others have talked about it  too) here on the Building Clouds Blog back in February 2013: Automation–Orchestrating Windows Azure–Solving the Public Cloud Puzzle with System Center 2012 SP1.

Back then it was rolled up as part of my “Orchestrating Windows Azure” example solution. It was the third use case in that solution, and demonstrated at the 11:48 timestamp of the associated video: Demo of OnPrem VM Move to Windows Azure via System Center 2012 SP1 Orchestrator and PS.

This portion of the existing solution executed the PowerShell necessary to upload a VHD to Windows Azure and then deploy a VM based on that uploaded VHD into an existing Windows Azure environment (Affinity Group, Cloud Service, Storage Resources, etc.). This Windows Azure environment was pre-created as part of the first portion of the existing solution (demonstrated in that same video at the 00:58 timestamp: Demo of Windows Azure VM Deployment Creation via System Center 2012 SP1 Orchestrator) , and built using System Center Orchestrator's Integration Pack for Windows Azure.

End history lesson.

Hybrid Clouds with Windows Azure – Automated

What I have for you in this blog series is a little different. The examples here are 100% PowerShell, no System Center Orchestrator or Integration Packs required. I did this for two reasons:

  1. To offer something new, different and more foundational - leveraging out-of-the-box Windows Server functionality (Windows PowerShell) with easily accessible Command line tools (Windows Azure PowerShell)
  2. To provide a simple transition for this use case, from Orchestrator to Service Management Automation (Part 2 of this blog series is all about PowerShell Workflow)

What’s being automated?

The examples provided include the following High Level Concepts:

  1. Creation of a new Public Cloud Environment (Affinity Group, Cloud Service, Storage Resources, etc.), leveraging an existing Subscription to Windows Azure
  2. Copying a VHD from an “On-Prem” Windows Server to that new Public Cloud Environment in Windows Azure
  3. Creation of a VM Image from that uploaded VHD, and then creation of a VM based on that VM Image
  4. Deprovisioning of all Provisioned Public Cloud Environment resources

Note Obviously, there are other methods and concepts to be automated for Windows Azure - these are just the ones I chose for the examples in this blog series.

High Level Concept Commands

Public Cloud Environment Provisioning

  1. Establish Windows Azure Subscription Connection
  2. Create Windows Azure Affinity Group
  3. Create Windows Azure Cloud Service
  4. Create Windows Azure Storage Account
  5. Create Windows Azure Storage Container
  6. Upload “On-Prem” VHD to Windows Azure Storage Container
  7. Copy Windows Azure Blob
  8. Create Windows Azure VM Image
  9. Create Windows Azure VM

Note Remember, this is a “ground up” (or “On-Prem” up – RDRR) example solution. It assumes no (and does not require) other (related) Affinity Groups, Cloud Services, Storage Resources, etc. before creation.

Public Cloud Environment Deprovisioning

  1. Remove Windows Azure VM
  2. Remove Windows Azure VM Image
  3. Remove Windows Azure VM Disk(s)
  4. Remove Windows Azure Storage Account (and Storage Account Resources)
  5. Remove Windows Azure Storage Blob(s)
  6. Remove Windows Azure Storage Container(s)
  7. Remove Windows Azure Cloud Service
  8. Remove Windows Azure Affinity Group

Automating Hybrid Clouds with Windows Azure and PowerShell - Blog Series - Table of Contents

I broke this “Automating Windows Azure” topic up into four posts – primarily to make it easier to reference externally (based on varied interest levels).

As promised, the following is the link to the TechNet Contribution and Download for the examples (from all parts of the blog series).

TechNet Contribution and Download

The download (Hybrid Cloud Automation Toolkit - Windows Azure and includes the following (4) files:

  • Provision-WindowsAzureEnvironmentResources.ps1
  • Provision-WindowsAzureEnvironmentResources-Workflow.ps1
  • Deprovision-WindowsAzureEnvironmentResources.ps1
  • Provision-Deprovision-Extras.ps1

Download the Hybrid Cloud Automation Toolkit - Windows Azure and PowerShell from TechNet Gallery here:


Thanks for checking out this blog series! For more information, tips/tricks, and example solutions for Automation within System Center, Windows Azure Pack, Windows Azure, etc., be sure to check out the other blog posts from Building Clouds in the Automation Track!