Introducing Windows Azure. INTRODUCING CLOUD COMPUTING Windows Azure.
Windows Azure Application Lifecycle
description
Transcript of Windows Azure Application Lifecycle
Windows Azure Application LifecycleNameTitleMicrosoft Corporation
Agenda
DeploymentMinimizing DowntimeDebugging
Deployment
Two Independent Environments
Production Staging
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
Upload to Windows Azure
Packaging & DeploymentMicrosoft
Visual StudioWeb Role
Worker Role
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
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
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
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
ToolsWindows Azure Tools for Visual Studio CSPackCSRunCSManagePowershell Cmdlets
Windows Azure Tools for Visual StudioProject TemplatesUser Interface ExtensionsStorage Explorer Server Explorer Integrated DeploymentIntelliTrace DebuggingProfiling Support
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
Windows Azure Storage ExplorerAn extension to the Visual Studio Server ExplorerView data from Windows Azure StorageDownload Asynchronously Blob data cached locally
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
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
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.
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
Preparing to use Management APIRetrieve Thumbprint IdRetrieve Subscription IdManipulate ServicesBy explicit service name or;Enumerate services using management API
Managing Certificates
Subscription Id and Service Name
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
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
Automating Your DeploymentSetting up the ServiceMSBuild CSPack.exeUpload Package to StorageCSManage.exe / PowerShell CmdletDeployRun
Automating Your DeploymentTestCSManage.exe / PowerShell CmdletSuspendDeleteMS Build Script Example:http://tinyurl.com/4uhal5t
Minimizing Downtime
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
Web Role
Example Service Model for Upgrade
Four Instances
Web Role
Four Instances
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
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
VIP Swap UpgradeDeployment
VM
VM
VM
VM
Prod
StageDeployment
In-Place UpgradePerforms a rolling upgrade on live serviceLeverages Upgrade DomainsDeveloper Portal & Service Management APIAutomatic or ManualOperating System Patches
In-Place UpgradeRack
VM
Rack
VM#1
VM VM#2
VM VM#1
VM VM#2
Prod
Debugging
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
IntelliTraceIntended for Debug Scenarios OnlyRequires .NET 4 & Visual Studio 2010 UltimateMust be enabled when publishing serviceChild processes cannot be IntelliTrace debugged
IntelliTraceLogs are collected to a file in file system on VMLogs downloaded via Server Explorer in Visual StudioReplay events in Visual Studio
Profiling
Four Collection Methods
CPU sampling
.NET Memory Allocation
Instrumentation
Concurrency
Intellitrace
demo
SummaryDeploymentCode -> Package -> Upload -> DeployService Management ApiWindows Azure ToolsAutomating the entire lifecycle
Minimizing DowntimeFault and Upgrade DomainsIn Place Upgrade vs VIP Swap
DebuggingDevelopment FabricIntelliTrace
© 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.