Automating Windows Azure

  • 1,301 views
Uploaded on

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

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

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,301
On Slideshare
0
From Embeds
0
Number of Embeds
17

Actions

Shares
Downloads
27
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    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

Transcript

  • 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
  • 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. www.devconnections.com AUTOMATING WINDOWS AZURE HOW STUFF WORKS 6 HTTP Management APIs
  • 7. www.devconnections.com AUTOMATING WINDOWS AZURE HOW STUFF WORKS 7
  • 8. www.devconnections.com AUTOMATING WINDOWS AZURE HOW STUFF WORKS 8 HTTP Management APIs HTTPS x.509 Client Cert. XML
  • 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. www.devconnections.com AUTOMATING WINDOWS AZURE HOW TO AUTOMATE 10
  • 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>
  • 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. 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. 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. www.devconnections.com AUTOMATING WINDOWS AZURE AUTOMATING WINDOWS AZURE Seeing is Believing! 17
  • 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. 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