web roleworker role at runtime each role will execute on one or more instances a role instance is a...
TRANSCRIPT
![Page 1: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/1.jpg)
![Page 2: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/2.jpg)
Session Objectives and Takeaways
Describe Windows Azure Cloud Service
Understand Model and Terminology
![Page 3: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/3.jpg)
What is a Cloud Service?
A container of related service roles
Web Role Worker Role
![Page 4: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/4.jpg)
Roles and Instances
At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed in a dedicated VM
Roles are defined in a Hosted ServiceA role definition specifies:VM sizeCommunication EndpointsLocal storage resourcesetc.
![Page 5: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/5.jpg)
Roles and InstancesExample Hosted Service configuration with a single web role and a single worker role
HOSTED SERVICE
VM1 VM2 VM3 VM4
VM5 VM6 VM7 VM8
VM9 VMn
VM1 VM2 VM3 VM4
VM5 VMn
![Page 6: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/6.jpg)
The High Scale Application ArchetypeWindows Azure provides a ‘pay-as-you-go’ scale out application platform
Async Activation
Network Activation
![Page 7: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/7.jpg)
Windows Azure SDKs and Tools
.NetVisual Studio ToolsClient Libraries for .Net
Node.jsPowerShell ToolsNode.js for WindowsIISNodeClient Libraries for Node.js
JavaEclipse ToolsClient Libraries for Java
phpCommand Line ToolsClient Libraries for php
![Page 8: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/8.jpg)
Windows Azure for .Net Developers
Visual Studio 2010/2012
Project Templates
Model & Config Tooling
Package & 1 Click Deploy
Debugging Support
Storage Explorer
Server Explorer
IntelliTrace Support
Profiling Support
![Page 9: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/9.jpg)
Worker Role Patterns
Poll and Pop Messages within while(true) loopE.g. Map/Reduce pattern, background image processing
Create TcpListener or WCF Service HostE.g. Run a .NET SMTP server or WCF Service
OnStart or Run method executes Process.Start()Startup Task installs or executes background/foreground processCustom Role Entry Point (executable or .Net assembly)E.g. Run a database server, web server, distributed cache
![Page 10: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/10.jpg)
Web Role
Webforms or MVCFastCGI applications (e.g. PHP)Multiple Websites
Can optionally implement RoleEntryPoint
![Page 11: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/11.jpg)
Understanding Packaging and ConfigWindows Azure Services are described by two important artifacts:Service Definition (*.csdef)Service Configuration (*.cscfg)
Your code is zipped and packaged with definition (*.cspkg)Encrypted(Zipped(Code + *.csdef)) == *.cspkg
Windows Azure consumes just (*.cspkg + *.cscfg)
![Page 12: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/12.jpg)
Describes the shape of your Windows Azure ServiceDefines Roles, Ports, Certificates, Configuration Settings, Startup Tasks, IIS Configuration, and more…
Can only be changed by upgrades or new deployments
![Page 13: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/13.jpg)
<?xml version="1.0" encoding="utf-8"?><ServiceDefinition name="WebDeploy" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<WebRole name="WebUX"><Startup>
<Task commandLine="..\Startup\EnableWebAdmin.cmd" executionContext="elevated" taskType="simple" /></Startup><Imports>
<Import moduleName="RemoteAccess" /><Import moduleName="RemoteForwarder"/>
</Imports><Sites>
<Site name="Web"><Bindings> <Binding name="HttpIn" endpointName="HttpIn"/></Bindings>
</Site></Sites><Endpoints>
<InputEndpoint name="HttpIn" protocol="http" port="80"/><InputEndpoint name="mgmtsvc" protocol="tcp" port="8172" localPort="8712"/>
</Endpoints>
![Page 14: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/14.jpg)
Supplies Runtime Values (Scale, Config Settings, Certificates to use, VHD, etc.)
Can be updated any time through Portal or API
![Page 15: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/15.jpg)
<?xml version="1.0"?><ServiceConfiguration serviceName="WebDeploy" xmlns="http://schemas.microsoft.com/serviceHosting/2008/10ServiceConfiguration"> <Role name="Webux">
<Instances count="1"/><ConfigurationSettings>
<Setting name="DiagnosticsConnectionString" value="UseDevelopmentStorage=true/><Setting name="Microsoft.WindowsAzure.plugins.RemoteAccess.Enabled" value="True"/><Setting name="Microsoft.WindowsAzure.plugins.RemoteAccess.AccountUsername" value="dunnry"/><Setting name="Microsoft.WindowsAzure.plugins.RemoteAccess.AccountEncryptedPassword" value="MIIBrAYJKoZIhvcNAQcDoIIB"/><Setting name="Microsoft.WindowsAzure.plugins.RemoteAccess.AccountExpiration" value="2010-12-23T23:59:59.0000000-07"/><Setting name="Microsoft.Windows Azure.Plugins.RemoteForwarder.Enabled" value="True"/>
<ConfigurationSettings><Certificate>
<Certificates name="Microsoft.WindowsAzure.Plugins.remoteAccess.PasswordEncryption" thumbprint="D6BE55AC439FAC6CBEBAF"/>
</Certificate></Role>
</ServiceConfiguration>
![Page 16: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/16.jpg)
VM Size in Windows Azure
Windows AzureSupports Various VM SizesSize set on Role in Service Definition - All instances of role will be of equal size Service can have multiple rolesBalance of Performance per node vs. High Availability from multiple nodes
Extra Small
Shared 1.0 GHz 768M 20GB .02
Small 1 1.6 GHz 1.75GB 225GB .12
Medium 2 1.6 GHz 3.5GB 490GB .24
Large 4 1.6 GHz 7GB 1,000GB .48
Extra large
8 1.6 GHz 14GB 2,040GB .96
![Page 17: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/17.jpg)
More small instances == more redundancy
Some scenarios will benefit from more coresWhere moving data >$ parallel overheadE.g. Video processing, Stateful services (DBMS)
Choosing Your VM Size
Don’t just throw big VMs at every problem
Scale out architectures have natural parallelism
Test various configurations under load
![Page 18: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/18.jpg)
Local Storage
Role instances have available disk storage
Use LocalStorage element in service definitionNameCleanOnRoleRecycleSize
Persistent but not guaranteed durableGood for cached resources or temporary files
Windows Azure Storage Drives provide guaranteed durable storage
![Page 19: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/19.jpg)
Local Storage
<LocalResources>
<LocalStoragename="myLocalDisk" sizeInMB="10"
cleanOnRoleRecycle="false" />
</LocalResources>
string rootPath = RoleEnvironment.GetLocalResource["myLocalDisk"].RootPath;
DirectoryInfo di = new DirectoryInfo(rootPath);
foreach(di.EnumerateFiles())
….
![Page 20: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/20.jpg)
Upgrading Your Application
VIP Swap:Uses Staging and Production environmentsAllows to quickly swap environmentsProduction: v1 Staging: v2, after swap then Production: v2 Staging: v1
In-Place UpgradePerforms a rolling upgrade on live serviceEntire service or a single roleManual or Automatic across update domainsCannot change Service Model
![Page 21: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/21.jpg)
ROLE
VIP Swap
VM1 VM2
VM3 VM4
VM1 VM2
VM3 VM4
![Page 22: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/22.jpg)
Summary
Cloud Service is for multi-tier online services
Service model defines service shape
Service configuration defines service scale
Selectable VM Sizes
Upgrading and Deployment
![Page 23: Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed](https://reader035.vdocuments.mx/reader035/viewer/2022070307/551a0ff0550346a4248b49f0/html5/thumbnails/23.jpg)
© 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.