1. Ido Flatow
Senior Architect
Microsoft MVP
SELA Group
Automating Windows Azure
Because the Management Portal is so 2012
@idoFLATOW
http://bit.ly/flatow-blog
This presentation:
http://sdrv.ms/13HplxU
2. www.devconnections.com
AUTOMATING WINDOWS AZURE
ABOUT ME
Senior architect, Sela Group
Co-author of:
Developing Windows Azure and Web Services –
Microsoft official course
WCF 4 – Microsoft official course
Pro .NET Performance – Apress
Microsoft MVP
Focus on server, services, and cloud
technologies
Manager of the Israeli Web Developers User
Group
3. www.devconnections.com
AUTOMATING WINDOWS AZURE
DEPLOYMENT SCENARIOS
New product version/build
Creating new environments (dev, test, staging)
Deploying to new data centers
Provisioning components for new tenants
(multitenant applications)
Installing entire system using customer’s
subscription
Disaster recovery
3
4. www.devconnections.com
AUTOMATING WINDOWS AZURE
WE NEED AUTOMATION BECAUSE
4
The checklist becomes annoying after
the third time
We miss a step during each and every
deployment
Someone will eventually need to update
the deployment instructions (but not me!)
Five VMs done, 45 to go
We want to go home before dawn
9. www.devconnections.com
AUTOMATING WINDOWS AZURE
WHAT CAN WE AUTOMATE?
9
Web Sites Virtual Machines Mobile Services Cloud Services
SQL Database Storage
Media Services Service Bus
Virtual Network Traffic Manager
Locations Affinity Groups Certificates
SQL ReportingHDInsight Recovery Services
Active Directory CDN
AlertsLinked Resources
Has HTTP APIs No HTTP APIs
11. www.devconnections.com
AUTOMATING WINDOWS AZURE
COMMAND LINE TOOLS
Command Line Interface (CLI)
Runs on Windows, Mac, and
Linux
Written in Node.js
Commands can return JSON
Scripting with:
Linux tools, such as grep,
awk, and sed
Javascript with Azure-scripty
(node-based)
PowerShell Cmdlets
Run only on Windows
Larger toolset
Commands return .NET
objects
Scripting with
PowerShell piping
PowerShell scripts
11
12. www.devconnections.com
AUTOMATING WINDOWS AZURE
THE BASICS:
AZURE ACCOUNTS
12
Get-AzurePublishSettingsFile
Import-AzurePublishSettingsFile $pathToPublishSettingsFile
# Or manually set the subscription
Set-AzureSubscription -subscriptionname $name -certificate $cert
-subscriptionid $id
azure account download
azure account import <pathToPublishSettingsFile>
13. www.devconnections.com
AUTOMATING WINDOWS AZURE
THE BASICS:
WEB SITES & CLOUD SERVICES
13
New-AzureWebsite -Name $name -Location "East US“
New-AzureService -ServiceName $name -Location “East US“
azure site create --location "East US" <Name>
azure service create --location "East US" <Name>
16. www.devconnections.com
AUTOMATING WINDOWS AZURE
SUPPORTED SERVICES
SQL Database Storage
Service Bus
HDInsight
Web Sites Virtual Machines Cloud Services Mobile Services
Virtual Network
Affinity Groups Certificates
SQL Database Storage
Service Bus
Web Sites Virtual Machines Cloud Services
Virtual Network
Affinity Groups Certificates Locations Name Test
Store Add-ons
18. www.devconnections.com
AUTOMATING WINDOWS AZURE
WHAT ABOUT ALL THE REST?
Use the HTTP-based APIs
Require some coding (curl, python, C#, …)
Don’t forget to authenticate
MSDN documentation is available
http://msdn.microsoft.com/library/jj152841.aspx
You are not the first one to try this
Windows Azure SDK (Python, Node, PHP, Ruby, …)
ElastaCloud Azure Fluent Management (.NET)
Windows Azure Service Management Library (.NET)
18
Media Services Traffic Manager VNet Gateway Management Certs. …
Cloud services – more options in powershellStorage – more options in powershellVirtual network – CLI can add networks, powershell can only replace all the configuration, but has gateway cmdlets