microsoft confidential automation query, manage and configure windows azure resources (vms, cloud...

32

Upload: sybil-oconnor

Post on 19-Jan-2016

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)
Page 2: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Take Control of the CloudWindows Azure PowerShellMichael WashamPrincipal Cloud ArchitectAditi

WAD-B305

Page 3: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Microsoft Confidential

What can you do with Windows Azure from PowerShell?

NetworkingConfigure and Manage Virtual Network configuration and VPN gateway management.

Provision Fully Composed Virtual Machines

AutomationQuery, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…) across multiple subscriptions and data centers.

StorageUpload and Download VHDs from Your Windows Azure Storage Accounts to your on-premises servers. Copy VHDs between Storage Accounts and Subscriptions.

Page 4: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Microsoft Confidential

Getting Started with the PowerShell Cmdlets• http://www.windowsazure.com/en-us/downloads/

• Import-Module Azure• Get-AzurePublishSettingsFile # Once • Import-AzurePublishSettingsFile # Once • Set-AzureSubscription –CurrentStorageAccount • Select-AzureSubscription SubscriptionName• Some-Windows-Azure-Cmdlet

Page 5: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Getting Started with Windows Azure PowerShellDEMO

Page 6: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Updating Existing Virtual Machines

$config = Get-AzureVM ... # Return the VM ConfigAdd-AzureDataDisk -VM $config.VM ... # Modify the returned VMAdd-AzureEndpoint -VM $config.VM ... # Modify the returned VMUpdate-AzureVM -VM $config.VM # Call Update

Get-AzureVM … | # Return the VM Config Add-AzureDataDisk … | # Modify the returned VM Add-AzureEndpoint … | # Modify the returned VM Update-AzureVM # Call Update

Page 7: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Updating a Virtual Machine

DEMO

Page 8: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Remote Management with PowerShell

Client

CloudEnabled by Default

Https Cert Generated or Specify your Own

Http Optional for VM to VM PowerShell

Use for in Guest Customization or Monitoring

Page 9: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Remote PowerShell Details

-WaitForBootNew-AzureVM and New-AzureQuickVM support optionally waiting until the VM is ready.

Setting up the Connection$uri = (Get-AzureWinRMUri -ServiceName $svc -Name $vmname).ToString()

Download and Install Generated Certificate (helper function)InstallWinRMCert -ServiceName $svc -Name $vmname

Execute a Script BlockInvoke-Command -ConnectionUri $uri -Credential $creds -ScriptBlock $block

Enter into a remote PowerShell SessionEnter-PSSession -ConnectionUri $uri -Credential $creds

Page 10: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Remote PowerShell

DEMO

Page 11: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Image and Disk Mobility

On-Premises Cloud

Blob Storag

eMyApp.vhd

Add-AzureVHD

Save-AzureVHD

Page 12: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Microsoft Confidential

Migrating Existing Virtual MachinesAdd-AzureVhd … # Upload VHD FilesAdd-AzureDisk … # Register Uploaded VHDs as Disks

New-AzureVMConfig –DiskName … | # Config based on disk Add-AzureDataDisk … | # Add additional data disks New-AzureVM … # Deploy Virtual Machine

Page 13: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

VHD Mobility

DEMO

Page 14: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Asynchronous Blob Copy

Client

Storage Service

Source

Blob Source

Destination

BlobStorage

Start-AzureStorageBlobCopy

MyApp.vhd

Copy from Source to Destination

Page 15: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Copying VHDs between Data Centers

DEMO

Page 16: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Any IP

Access Control Listsmysqlserver1.cloudapp.netIP: 137.135.67.39

Rules (up to 50)• Permit: Allow

• RemoteSubnet: 168.62.20.14/32

• Description: Only Website

• Order 1

Virtual MachineRole Name: sqlvm1Subnet: BackEndSubnetIP Address: 10.3.3.4

WA Website

Fabrikam.comIP: 168.62.20.14

Some bot

“owned” machineIP: 150.48.12.5

Endpoint for port 1433 with ACL

Page 17: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Configuring Access Control Lists

$acl = New-AzureAclConfig

Set-AzureAclConfig -AddRule Permit -RemoteSubnet "209.116.0.0/16" `

-Order 1 -ACL $acl -Description "Restrict SSH"

Get-AzureVM -ServiceName mwlinuxsvc1 -Name mwlinux | Set-AzureEndpoint -Name ssh -Protocol tcp -PublicPort 22 `

-LocalPort 22 -ACL $acl | Update-AzureVM

Page 18: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Locking down an Endpoint

DEMO

Page 19: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Designing for Scale and Availability

Page 20: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Availability and Load Balanced Sets Availability Sets• Distributes your VMs on separate physical

hardware• Tells the fabric controller in what order to

update virtual machines (rolling upgrades)• 99.95% SLA

Load Balanced Endpoint Sets• Distribute traffic in round robin based on

port and protocol• Health Probes allow your application to

report health to the LB

Page 21: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

End to End Highly Available Solution• Redundancy at every level

LB

Internet

SQL-AVSET

IIS-AVSETWeb

Server

Web Server

Database

Database

Page 22: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

TCP Load Balancer Custom Probes

Default when creating with PowerShell

Load Balancer Polls Every 15 seconds

Looks for ACK on socket connect

Traffic stops until ACK received

Continues Polling

Page 23: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

HTTP 500

HTTP Load Balancer Custom Probes

Load Balancer Polls Every 15 seconds

Receives other than 200 OK (HTTP)

Traffic stops until 200 Received

Continues Polling

Page 24: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Configuring Load Balanced EndpointsDemo

Page 25: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Microsoft Confidential

Windows Azure Cloud Services ManagementDeploy .cspkg and .cscfg Files for Cloud Services• Deploy to Windows Azure Virtual Networks• Restart, Reimage and Change Role

Instance Count• Enable/Disable RDP and Diagnostics• Change Configuration • Upgrade (Automatic, Manual and

Simultaneous)• Scaffold Existing or New Applications in

Node.js, PHP, Python and .NET

Page 26: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Deploying and Managing Cloud Services

Demo

Page 27: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Wrapping Up

You just saw…TONS of Powerful Cloud Automation with PowerShellQuestions?

For More Information: Follow me on Twitter @MWashamMSPowerShell Examples: michaelwasham.com

Page 28: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Microsoft Confidential

Track Resources & Calls To ActionGet Started with Windows Azure

Develop and Test in VMs, Build Websites, Extend on-premises applicationshttp://www.windowsazure.com

*No purchase necessary. Open to eligible Visual Studio Professional, Premium or Ultimate with MSDN subscribers as of June 1, 2013. Ends 11:59 p.m. PT on September 30, 2013. For full official rules including odds, eligibility and prize restrictions see website. Sponsor: Microsoft Corporation. Aston Martin is a trademark owned and licensed by Aston Martin Lagonda Limited. Image copyright Evox Images. All rights reserved.

Drop by the Windows Azure booth to participate in the Windows Azure Challenge for even more prizes!

MSDN Subscribers: you’ve got it, now use itActivate your MSDN Benefit & try it by 9/30You could win* an Aston Martin V8 Vantage!Go to: http://aka.ms/AzureContest

Page 29: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

msdn

Resources for Developers

http://microsoft.com/msdn

Learning

Microsoft Certification & Training Resources

www.microsoft.com/learning

TechNet

Resources

Sessions on Demand

http://channel9.msdn.com/Events/TechEd

Resources for IT Professionals

http://microsoft.com/technet

Page 30: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Complete an evaluation on CommNet and enter to win!

Page 31: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

Evaluate this session

Scan this QR code to evaluate this session and be automatically entered in a drawing to win a prize

Page 32: Microsoft Confidential Automation Query, Manage and Configure Windows Azure resources (VMs, Cloud Services, Websites, Storage, Queues, Databases etc…)

© 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.