Automating Windows Azure
Post on 15-Nov-2014
1826 Views
Preview:
DESCRIPTION
Transcript
Ido FlatowSenior Architect
Microsoft MVPSELA Group
Automating Windows Azure
Because the Management Portal is so 2012
@idoFLATOWhttp://bit.ly/flatow-blog
This presentation:http://sdrv.ms/
13HplxU
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
www.devconnections.com
AUTOMATING WINDOWS AZURE
3
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
www.devconnections.com
AUTOMATING WINDOWS AZURE
4
WE NEED AUTOMATION BECAUSE
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
www.devconnections.com
AUTOMATING WINDOWS AZURE
5
WE NEED AUTOMATION BECAUSE
We just want something to double-click so
we can go home on time!
www.devconnections.com
AUTOMATING WINDOWS AZURE
6
HOW STUFF WORKS
HTTP Management APIs
www.devconnections.com
AUTOMATING WINDOWS AZURE
7
HOW STUFF WORKS
www.devconnections.com
AUTOMATING WINDOWS AZURE
8
HOW STUFF WORKS
HTTP Management APIs HTTPS
x.509 Client Cert.
XML
www.devconnections.com
AUTOMATING WINDOWS AZURE
9
WHAT CAN WE AUTOMATE?
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
www.devconnections.com
AUTOMATING WINDOWS AZURE
10
HOW TO AUTOMATE
www.devconnections.com
AUTOMATING WINDOWS AZURE
11
COMMAND LINE TOOLSCommand 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
www.devconnections.com
AUTOMATING WINDOWS AZURE
12
THE BASICS:AZURE ACCOUNTS
Get-AzurePublishSettingsFile
Import-AzurePublishSettingsFile $pathToPublishSettingsFile
# Or manually set the subscriptionSet-AzureSubscription -subscriptionname $name -certificate $cert -subscriptionid $id
azure account download
azure account import <pathToPublishSettingsFile>
www.devconnections.com
AUTOMATING WINDOWS AZURE
13
THE BASICS:WEB SITES & CLOUD SERVICES
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>
www.devconnections.com
AUTOMATING WINDOWS AZURE
14
THE BASICS:VIRTUAL MACHINES
$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
www.devconnections.com
AUTOMATING WINDOWS AZURE
15
VIRTUAL MACHINESWITH AZURE-SCRIPTY
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’
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
www.devconnections.com
AUTOMATING WINDOWS AZURE
17
AUTOMATING WINDOWS AZURESeeing is Believing!
www.devconnections.com
AUTOMATING WINDOWS AZURE
18
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)
Media Services Traffic Manager VNet Gateway Management Certs. …
www.devconnections.com
AUTOMATING WINDOWS AZURE
19
RESOURCES
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
top related