Download presentation
Presentation is loading. Please wait.
Published byKelley Cummings Modified over 8 years ago
1
Windows Azure Custom Software Development Mobile Middleware Windows Azure Compute Dipl.-Ing. Damir Dobric Lead Architect daenet damir.dobric@daenet.com b-dadobr@microsoft.com Microsoft vTSP – Germany Technology Advisor in Business Platform Division – Microsoft Corp. Microsoft Most Valuable Professional
2
Windows Azure Custom Software Development Mobile Middleware Windows Azure in a Slide Desktop VS Tools WA SDK Storage Cluster MSFT Datacenters Business Portal Developer Portal Compute Cluster … … Service Management Service REST … Cloud VM Runtime API VM Setup User Code
3
Windows Azure Custom Software Development Mobile Middleware VM Size in Windows Azure Windows Azure – Supports Various VM Sizes – Size set on Role in Service Definition – Service can have multiple roles – Balance of Performance per node vs. High Availability from multiple nodes – Set in Service Model definition All instances of role will be of equal size SizeCPU CoresRAMLocal StorageCost Extra SmallShared768M20GB.05 Small11.7GB250GB.12 Medium23.5GB500GB.24 Large47GB1000GB.48 Extra large815GB2000GB.96
4
Windows Azure Custom Software Development Mobile Middleware Virtual Machine Sizes
5
Windows Azure Custom Software Development Mobile Middleware Services, Roles & Instances Web Applications – Developed as Web Role – Running in Web Service (IIS) Backend Applications – Developed as Worker Role – Have no UI – Running in dedicated container process Legacy Applications – Deployed on Virtual Machine – Called VM-Role Applications
6
Windows Azure Custom Software Development Mobile Middleware Services, Roles & Instances Service Model (Deployment) Web Role Indicates that role is running in cluster across 4 instances (at 4 different machines) Worker Role running on one instance Web Service (Web Role) running on one instance
7
Windows Azure Custom Software Development Mobile Middleware Roles and Instances Roles are defined in a Service Model – May define one or more Roles per Service – A role definition specifies VM size Communication Endpoints Local storage resources Etc… At runtime each Role will execute on one or more instances (up to 20 per subscription) – A role instance is a set of code, configuration, and local data, deployed in a dedicated VM
8
Windows Azure Custom Software Development Mobile Middleware Windows Azure Service Architecture Tables LB Blobs Worker Service Worker Role Managed Interface Call Worker Role Managed Interface Call Web Site (ASPX, ASMX, WCF) Web Site (ASPX, ASMX, WCF) Web Site (ASPX, ASMX, WCF) Web Site (ASPX, ASMX, WCF) Web Role IIS as Host Web Role IIS as Host Queues Windows Azure Data Center LB The Internet The Internet via TCP or HTTP
9
Windows Azure Custom Software Development Mobile Middleware Role Programming Model Inherits RoleEntryPoint OnStart() Method – Called by Fabric on startup, allows you to perform initialization tasks. – Reports Busy status to load balancer until you return true. Run() Method – Main logic is here – can do anything, typically infinite loop. Should never exit. OnStop() Method – Called when role is to be shutdown, graceful exit. – 30 Seconds to tidy up
10
Windows Azure Custom Software Development Mobile Middleware Role Lifecycle
11
Windows Azure Custom Software Development Mobile Middleware Demo Developing Cloud Application with Visual Studio
12
Windows Azure Custom Software Development Mobile Middleware Worker Role Patterns Queue Polling Worker – Poll and Pop Messages within while(true) loop – E.g. Map/Reduce pattern, background image processing Listening Worker Role – Create TcpListener or WCF Service Host – E.g. Run a.NET SMTP server or WCF Service External Process Worker Role – OnStart or Run method executes Process.Start() – Startup Task installs or executes background/foreground process – E.g. Run a database server, web server, distributed cache
13
Windows Azure Custom Software Development Mobile Middleware DEMO Worker Role
14
Windows Azure Custom Software Development Mobile Middleware Web Role All features of a worker role + IIS 7 or 7.5 ASP.NET 3.5 SP1 or 4.0 – 64bit Hosts – Webforms or MVC – FastCGI applications (e.g. PHP) – Multiple Websites – Web Api Http(s) Web/Worker Hybrid – Can optionally implement RoleEntryPoint
15
Windows Azure Custom Software Development Mobile Middleware DEMO Web Role
16
Windows Azure Custom Software Development Mobile Middleware Packaging & Config Windows 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)
17
Windows Azure Custom Software Development Mobile Middleware Service Definition Describes the shape of your Windows Azure Service – Defines Roles, Ports, Certificates, Configuration Settings, Startup Tasks, IIS Configuration, and more… Can only be changed by upgrades or new deployments
18
Windows Azure Custom Software Development Mobile Middleware Service Configuration Supplies Runtime Values (Scale, Config Settings, Certificates to use, VHD, etc.) Can be updated any time through Portal or API
19
Windows Azure Custom Software Development Mobile Middleware Configuration Values Store arbitrary configuration string values – Define in model – Populate in configuration RoleEnvironment –.GetConfigurationSettingValue() Don’t use web.config for values you wish to change at runtime – App/Web.config is packaged with deployment change requires re- deploy – *.cscfg supports change tracking and notification to running role instances
20
Windows Azure Custom Software Development Mobile Middleware Handling Config Changes RoleEnvironment.Changing – Occurs before configuration is changed – Can be cancelled – causes a recycle RoleEnvironment.Changed – Occurs after config change has been applied RoleEnvironmentConfigurationSettingChange – Provides config value that was changed RoleEnvironmentTopologyChange – When role count is changed
21
Windows Azure Custom Software Development Mobile Middleware DEMO Working with Configuration
22
Windows Azure Custom Software Development Mobile Middleware Monitoring Monitoring is not Debugging Instrument your application using Trace, Debug – DiagnosticMonitorTraceListener Use Diagnostics API to Configure and Collect – Event Logs – Performance Counters – Trace/Debug information (logging) – IIS Logs, Failed Request Logs – Crash Dumps or Arbitrary files Request data on demand or scheduled – Transferred into your table and/or blob storage
23
Windows Azure Custom Software Development Mobile Middleware Deployment Incremental Upgrade – In-Place-Upgrade or Rolling Upgrade – No service changes are allowed – Upgrade domains Major Upgrade – Deployment of the new version – Deployment in Stage Environment – Uses VIP (virtual IP) swap https://www.windowsazure.com/en-us/develop/net/fundamentals/deploying-applications http://msdn.microsoft.com/en-us/library/windowsazure/hh472157.aspx
24
Windows Azure Custom Software Development Mobile Middleware Incremental Upgrade (InPlace) INSTANCE I (running v1.1) INSTANCE II (running v1.1) t INSTANCE I (stopped) INSTANCE II (running v1) Upgrading I INSTANCE I (running v1.2) INSTANCE II (running v1.1) 15 min test INSTANCE I (running v1.2) INSTANCE II (running v1.1) Upgrading II INSTANCE I (running v1.2) INSTANCE II (running v1.2)
25
Windows Azure Custom Software Development Mobile Middleware Upgrade Domains
26
Windows Azure Custom Software Development Mobile Middleware Upgrade Domains
27
Windows Azure Custom Software Development Mobile Middleware Upgrade one Role only
28
Windows Azure Custom Software Development Mobile Middleware VIP Swap
29
Windows Azure Custom Software Development Mobile Middleware VIP Swap
30
Windows Azure Custom Software Development Mobile Middleware Upgrading Your Application VIP Swap: – Uses Staging and Production environments. – Allows to quickly swap environments. – Production: v1 Staging: v2, after swap then Production: v2 Staging: v1. In-Place Upgrade – Performs a rolling upgrade on live service. – Entire service or a single role – Manual or Automatic across update domains – Cannot change Service Model
31
Windows Azure Custom Software Development Mobile Middleware DEMO Configuration Deployment MonitoringUpdate
32
Windows Azure Custom Software Development Mobile Middleware DEMO Configuration Deployment MonitoringUpdate
33
Windows Azure Custom Software Development Mobile Middleware
34
Windows Azure Custom Software Development Mobile Middleware Snippets DiagnosticMonitorConfiguration diagnosticConfig = DiagnosticMonitor.GetDefaultInitialConfiguration(); diagnosticConfig.Logs.ScheduledTransferPeriod = TimeSpan.FromSeconds(15); diagnosticConfig.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose; DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionStrin g", diagnosticConfig); ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application."; var storage = RoleEnvironment.GetLocalResource("LocalStorage1"); StreamWriter sw = new StreamWriter(Path.Combine(storage.RootPath, "mystoragefile.txt")); sw.WriteLine("New request arrived: {0}", DateTime.Now.ToString()); sw.Flush(); var val = RoleEnvironment.GetConfigurationSettingValue("MySetting"); sw.Close(); Trace.WriteLine(String.Format("New request arrived: {0}", DateTime.Now.ToString())); dynamic model = new ExpandoObject(); model.MySetting = val; return View(model as dynamic);
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.