41
Windows Azure Application Lifecycle Name Title Microsoft Corporation

Windows Azure Application Lifecycle

  • Upload
    talia

  • View
    37

  • Download
    0

Embed Size (px)

DESCRIPTION

Windows Azure Application Lifecycle. Name Title Microsoft Corporation. Agenda. Deployment Minimizing Downtime Debugging. Deployment. Two Independent Environments. Production. Staging. Production. Staging. Stages of Service Deployment. Stage 1: Local development and testing. - PowerPoint PPT Presentation

Citation preview

Page 1: Windows Azure Application Lifecycle

Windows Azure Application LifecycleNameTitleMicrosoft Corporation

Page 2: Windows Azure Application Lifecycle

Agenda

DeploymentMinimizing DowntimeDebugging

Page 3: Windows Azure Application Lifecycle

Deployment

Page 4: Windows Azure Application Lifecycle

Two Independent Environments

Production Staging

Page 5: Windows Azure Application Lifecycle

Production Staging

Stages of Service DeploymentStage 1: Local development and testing

Development Fabric

Development Storage

Stage 4: VIP Swap to Production

Stage 3: Test in Staging on Windows Azure Fabric

Windows Azure Fabric

Stage 2: Test in mixed mode with hosted data

Development Fabric

Page 6: Windows Azure Application Lifecycle

Upload to Windows Azure

Packaging & DeploymentMicrosoft

Visual StudioWeb Role

Worker Role

Page 7: Windows Azure Application Lifecycle

Deploying a Cloud Service from Visual StudioPublish to either Production or StagingPackage only or Deploy to Windows AzureThree things neededWindows Azure subscriptionWindows Azure hosted serviceWindows Azure storage account

Uses x509 certificate authentication

Page 8: Windows Azure Application Lifecycle

Geo-Location & Affinity GroupsDependent resourcesEnsures geo-locationin single datacentreCan specify sub-region also (Recommended)

Explicitly define sub-region on service by service basis

Windows Azure chooses sub-region(Not Recommended)

Affinity and Geo-Location Settings are Immutable

Specific Geo-located

Un-Affinitized

Affinitized

Page 9: Windows Azure Application Lifecycle

Guest OS VersioningWindows Azure Runs on Base OSBase OS revised regularlyBest practice is to specify OS versionGet latest version by default – using version ‘*’ gets auto-updatesUse osVersion attributeTo determine version in the cloud view config data in cloud<ServiceConfiguration serviceName="CloudService1“ osVersion="WA-

GUEST-OS-1.2_201003-01“>

Releases posted here: http://msdn.microsoft.com/ee924680

RELEASE CHANGES

WA-GUEST-OS-1.0_200912-01 Patches

WA-GUEST-OS-1.1_201001-01 Patches

WA-GUEST-OS-1.2_201003-01

PatchesURL Rewriting and Compression.NET 4.0 RC

WA-GUEST-OS-1.3_201004-01

Patches, .NET 4, URL Rewrite 2

Page 10: Windows Azure Application Lifecycle

Windows Azure Service Management API REST basedUses X509 client certificates for client authenticationHosted ServicesView, Create, Delete DeploymentSwap DeploymentModify configurationScale Up/Scale UpUpgrade deploymentWalk Upgrade Domain

Storage AccountsList AccountsGet Account PropertiesGet Account KeysRegenerate Keys

Certificates

ListAddGetDelete

Affinity GroupsListGet Properties

System Info

Get OS Version

Page 11: Windows Azure Application Lifecycle

ToolsWindows Azure Tools for Visual Studio CSPackCSRunCSManagePowershell Cmdlets

Page 12: Windows Azure Application Lifecycle

Windows Azure Tools for Visual StudioProject TemplatesUser Interface ExtensionsStorage Explorer Server Explorer Integrated DeploymentIntelliTrace DebuggingProfiling Support

Page 13: Windows Azure Application Lifecycle

Windows Azure Compute ExplorerView & Monitor deployments from Visual StudioNot possible to Start or Stop role instancesUses x509 Certificate AuthenticationRefreshes automatically by querying Windows Azure at regular intervals

Page 14: Windows Azure Application Lifecycle

Windows Azure Storage ExplorerAn extension to the Visual Studio Server ExplorerView data from Windows Azure StorageDownload Asynchronously Blob data cached locally

Page 15: Windows Azure Application Lifecycle

CSPack.execspack HelloFabric\ServiceDefinition.csdef

/role:HelloFabric_WebRole; HelloFabric_WebRole/out:HelloFabric.cspkg

cspack HelloCloudService.csdef/role:HelloCloudServiceWebRole; HelloCloudService/generateConfigurationFile:HelloCloudService.cscfg/out:HelloCloudServicePackage/copyOnly

Part of the Windows Azure SDKCommand line tool; called by VS.NET toolsPackages your service for deploymentExplicitly name & set location of Service Package

Page 16: Windows Azure Application Lifecycle

Command line tool; called by VS.NET toolsDeploys Service to Development Fabric Manages Running ServiceDump the logs of deployed instancesControl the state of the Development fabricControl Development Storage Service

CSRun.execsrun myservice.csx myservice.cscfg /launchbrowser

csrun /devfabric: shutdowncsrun /devfabric: clean

csrun /devstore: start

Page 17: Windows Azure Application Lifecycle

X.509 CertificatesManagement Service uses certificates for authenticationSelf-signedAny valid X.509 v3 with key length >= 2048 bits

makecert -r -pe -a sha1 -n CN=AzureMgmt -ss My -sky exchange "AzureMgmt.cer" Creates a new self-signed certificate, writes it to the "AzureMgmt.cer" file in the current directory and saves it to the CurrentUser\My certificate store.

Page 18: Windows Azure Application Lifecycle

Preparing to use Management APIMake / Acquire CertificatePay attention to ValidFrom,Local date could differ from Server

Prepare the Windows Azure AccountUpload certificate to Windows Azure accountAssociate up to 5 certificates per account

Page 19: Windows Azure Application Lifecycle

Preparing to use Management APIRetrieve Thumbprint IdRetrieve Subscription IdManipulate ServicesBy explicit service name or;Enumerate services using management API

Page 20: Windows Azure Application Lifecycle

Managing Certificates

Page 21: Windows Azure Application Lifecycle

Subscription Id and Service Name

Page 22: Windows Azure Application Lifecycle

csmanage /update-deployment /hosted-service :<service>/slot:staging /status:suspended

csmanage /delete-deployment /hosted-service :<service>/slot:staging

csmanage /create-deployment /hosted-service:<service>/slot:production/name:<name>/label:<label>/package:$(BlobStorageEndpoint)packages/ServicePackage.cspkg/config:$(SolutionDir)\ServiceConfiguration.cscfg

csmanage /update-deployment /hosted-service:<service>/slot:staging /status:running

Wrapper for the Service Management APIManage credentials for Storage AccountsDelete running ServicesView configuration of DeploymentsPut subscription id and certificate thumbprint in csmanage.exe.config

CSManage.exehttp://tinyurl.com/azuresamples

Page 23: Windows Azure Application Lifecycle

Wrap the Service Management APIWith pipelining the output from one command can be used as input to the next

PowerShell Cmdletshttp://wappowershell.codeplex.com

$cert = Get-Item cert:\CurrentUser\My\D6BE55AC439FEA8CBEBAFF432BDC0780F1BD00CF $sub = "CCCEA07B-1E9A-5133-8476-3818E2165063" $servicename = 'myazureservice' $package = "c:\publish\MyAzureService.cspkg" $config = "c:\publish\ServiceConfiguration.cscfg"

Add-PSSnapin WAPPSCmdlets

Get-HostedService $servicename -Certificate $cert -SubscriptionId $sub | Get-Deployment -Slot Production | Set-DeploymentStatus 'Running' | Get-OperationStatus -WaitToComplete

Get-HostedService $servicename -Certificate $cert -SubscriptionId $sub | Get-Deployment -Slot Production | Set-DeploymentConfiguration {$_.RolesConfiguration["WebUx"].InstanceCount += 1}

get serviceget production slot

set status to runningwait for async operation to finish

Page 24: Windows Azure Application Lifecycle

Automating Your DeploymentSetting up the ServiceMSBuild CSPack.exeUpload Package to StorageCSManage.exe / PowerShell CmdletDeployRun

Page 25: Windows Azure Application Lifecycle

Automating Your DeploymentTestCSManage.exe / PowerShell CmdletSuspendDeleteMS Build Script Example:http://tinyurl.com/4uhal5t

Page 26: Windows Azure Application Lifecycle

Minimizing Downtime

Page 27: Windows Azure Application Lifecycle

Fault & Upgrade DomainsFault DomainsRepresent groups of resources anticipated to fail togetheri.e. Same rack, same serverFabric spreads instances across fault domainsDefault of 2

Upgrade DomainsRepresents groups of resources that will be upgraded togetherSpecified by upgradeDomainCount in ServiceDefinitionDefault of 5

Fabric splits Upgrade Domains across Fault Domains and Across Roles

Page 28: Windows Azure Application Lifecycle

Web Role

Example Service Model for Upgrade

Four Instances

Web Role

Four Instances

Page 29: Windows Azure Application Lifecycle

Fault and Upgrade DomainsFault Domain

Rack

VM

VM

VM

VM

Fault DomainRack

VM

VM

VM

VM

U/G Domain #1

U/G Domain #2

U/G Domain #1

U/G Domain #2

Page 30: Windows Azure Application Lifecycle

VIP SwapSwap Virtual IPs between the two slotsProduction becomes StagingStaging becomes Production

Allows to quickly swap environmentsEssential for when service model has changedException: Changing public endpoints requires delete deployment

No downtime incurredDeveloper Portal & Service Management APIMaintains the same external IP address

Page 31: Windows Azure Application Lifecycle

VIP Swap UpgradeDeployment

VM

VM

VM

VM

Prod

StageDeployment

Page 32: Windows Azure Application Lifecycle

In-Place UpgradePerforms a rolling upgrade on live serviceLeverages Upgrade DomainsDeveloper Portal & Service Management APIAutomatic or ManualOperating System Patches

Page 33: Windows Azure Application Lifecycle

In-Place UpgradeRack

VM

Rack

VM#1

VM VM#2

VM VM#1

VM VM#2

Prod

Page 34: Windows Azure Application Lifecycle

Debugging

Page 35: Windows Azure Application Lifecycle

Debugging a Service in DevelopmentDebugging only supported in Development FabricVisual Studio attaches to all instances when debugger startsCan edit configuration whilst debuggingManaged Debugger by DefaultNative Code Debugging is supported

Page 36: Windows Azure Application Lifecycle

IntelliTraceIntended for Debug Scenarios OnlyRequires .NET 4 & Visual Studio 2010 UltimateMust be enabled when publishing serviceChild processes cannot be IntelliTrace debugged

Page 37: Windows Azure Application Lifecycle

IntelliTraceLogs are collected to a file in file system on VMLogs downloaded via Server Explorer in Visual StudioReplay events in Visual Studio

Page 38: Windows Azure Application Lifecycle

Profiling

Four Collection Methods

CPU sampling

.NET Memory Allocation

Instrumentation

Concurrency

Page 39: Windows Azure Application Lifecycle

Intellitrace

demo

Page 40: Windows Azure Application Lifecycle

SummaryDeploymentCode -> Package -> Upload -> DeployService Management ApiWindows Azure ToolsAutomating the entire lifecycle

Minimizing DowntimeFault and Upgrade DomainsIn Place Upgrade vs VIP Swap

DebuggingDevelopment FabricIntelliTrace

Page 41: Windows Azure Application Lifecycle

© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista 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.