Ido Flatow
Senior Architect
Microsoft MVP
SELA Group
Automating Windows Azure
Because the Management Portal is so 2012
@id...
www.devconnections.com
AUTOMATING WINDOWS AZURE
ABOUT ME
 Senior architect, Sela Group
 Co-author of:
 Developing Windo...
www.devconnections.com
AUTOMATING WINDOWS AZURE
DEPLOYMENT SCENARIOS
 New product version/build
 Creating new environmen...
www.devconnections.com
AUTOMATING WINDOWS AZURE
WE NEED AUTOMATION BECAUSE
4
 The checklist becomes annoying after
the th...
www.devconnections.com
AUTOMATING WINDOWS AZURE
WE NEED AUTOMATION BECAUSE
5
We just want something
to double-click so
we ...
www.devconnections.com
AUTOMATING WINDOWS AZURE
HOW STUFF WORKS
6
HTTP Management APIs
www.devconnections.com
AUTOMATING WINDOWS AZURE
HOW STUFF WORKS
7
www.devconnections.com
AUTOMATING WINDOWS AZURE
HOW STUFF WORKS
8
HTTP Management APIs
HTTPS
x.509 Client Cert.
XML
www.devconnections.com
AUTOMATING WINDOWS AZURE
WHAT CAN WE AUTOMATE?
9
Web Sites Virtual Machines Mobile Services Cloud S...
www.devconnections.com
AUTOMATING WINDOWS AZURE
HOW TO AUTOMATE
10
www.devconnections.com
AUTOMATING WINDOWS AZURE
COMMAND LINE TOOLS
Command Line Interface (CLI)
 Runs on Windows, Mac, an...
www.devconnections.com
AUTOMATING WINDOWS AZURE
THE BASICS:
AZURE ACCOUNTS
12
Get-AzurePublishSettingsFile
Import-AzurePub...
www.devconnections.com
AUTOMATING WINDOWS AZURE
THE BASICS:
WEB SITES & CLOUD SERVICES
13
New-AzureWebsite -Name $name -Lo...
www.devconnections.com
AUTOMATING WINDOWS AZURE
THE BASICS:
VIRTUAL MACHINES
14
$image = Get-AzureVMImage | ? {$_.ImageFam...
www.devconnections.com
AUTOMATING WINDOWS AZURE
VIRTUAL MACHINES
WITH AZURE-SCRIPTY
15
var scripty = require('azure-script...
www.devconnections.com
AUTOMATING WINDOWS AZURE
SUPPORTED SERVICES
SQL Database Storage
Service Bus
HDInsight
Web Sites Vi...
www.devconnections.com
AUTOMATING WINDOWS AZURE
AUTOMATING WINDOWS AZURE
Seeing is Believing!
17
www.devconnections.com
AUTOMATING WINDOWS AZURE
WHAT ABOUT ALL THE REST?
 Use the HTTP-based APIs
 Require some coding (...
www.devconnections.com
AUTOMATING WINDOWS AZURE
RESOURCES
19
Too many resources for a single slide
Presentation and resour...
Upcoming SlideShare
Loading in …5
×

Automating Windows Azure

1,969 views
1,776 views

Published on

Automatic Windows Azure with PowerShell and the Windows Azure CLI tools.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,969
On SlideShare
0
From Embeds
0
Number of Embeds
535
Actions
Shares
0
Downloads
34
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • 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
  • Automating Windows Azure

    1. 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. 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. 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. 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
    5. 5. www.devconnections.com AUTOMATING WINDOWS AZURE WE NEED AUTOMATION BECAUSE 5 We just want something to double-click so we can go home on time!
    6. 6. www.devconnections.com AUTOMATING WINDOWS AZURE HOW STUFF WORKS 6 HTTP Management APIs
    7. 7. www.devconnections.com AUTOMATING WINDOWS AZURE HOW STUFF WORKS 7
    8. 8. www.devconnections.com AUTOMATING WINDOWS AZURE HOW STUFF WORKS 8 HTTP Management APIs HTTPS x.509 Client Cert. XML
    9. 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
    10. 10. www.devconnections.com AUTOMATING WINDOWS AZURE HOW TO AUTOMATE 10
    11. 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. 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. 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>
    14. 14. www.devconnections.com AUTOMATING WINDOWS AZURE THE BASICS: VIRTUAL MACHINES 14 $image = Get-AzureVMImage | ? {$_.ImageFamily -like '*2012*Datacenter'} | sort $_.PublishedDate | select –first 1 New-AzureQuickVM -Windows -Name $name -Location "East US" -ImageName $image.ImageName -ServiceName $cloudServiceName -AdminUsername myAdmin -Password $password image=$(azure vm image list | grep 'Windows-Server-2012-Datacenter- 201308.01' | awk '{print ($2)}') azure vm create $name $image administrator $pass --location "East US" -r
    15. 15. www.devconnections.com AUTOMATING WINDOWS AZURE VIRTUAL MACHINES WITH AZURE-SCRIPTY 15 var scripty = require('azure-scripty'); scripty.invoke('vm image list', function(err, results) { var imageName = results[0].Name; cmd = { command: 'vm create', rdp: true, positional: [process.argv[2],imageName, 'administrator', process.argv[3]], location: '"' + process.argv[4] + '"'}; scripty.invoke(cmd); }); node createVM.js myNewVM mypassword ‘East US’
    16. 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
    17. 17. www.devconnections.com AUTOMATING WINDOWS AZURE AUTOMATING WINDOWS AZURE Seeing is Believing! 17
    18. 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. …
    19. 19. www.devconnections.com AUTOMATING WINDOWS AZURE RESOURCES 19 Too many resources for a single slide Presentation and resources can be found here: sdrv.ms/13HplxU idof@sela.co.il @idoflatow http://bit.ly/flatow-blog

    ×