Windows AzureCloud Services
Anton Boyko.NET developer
• A brief overview of Windows Azure Compute Services and application scenarios
• Windows Azure Cloud Services basics
• Windows Azure Cloud Service lifecycle
• Windows Azure Cloud Services communication capabilities
Agenda
Azure Compute
ManagementComplexity
Azure compute
Web Sites
Cloud Services Virtual Machines
ControlFlexibility
Your Datacenter
Virtualization
O/S
Hardware
Network
Data
Applications
Firewall
Web Sites
Applications
Data
Cloud Services
Applications
Firewall Rules
Data
Virtual Network
Virtual Machines
Virtual Network
Data
Applications
Firewall Rules
O/S
Focus on the Application
Windows Azure
Popular open source appsLaunch a professional looking site with a few clicks using apps like WordPress, Joomla!, Drupal, DotNetNuke and Umbraco
Continuous developmentDeploy directly from your source code repository, using Git or Team Foundation Service.
Modern web appsPerfect if your app consists of client side markup and scripting, server side scripting and a database. Powerful capability to scale out and up as needed.
Application ScenariosWeb Sites
Apps that require advanced administrationCloud-based applications that require admin access, remote desktop access or elevated permissions
Cloud Services
Multi-tier applicationsCloud-based applications that separate application logic into multiple tiers (i.e. caching middle tier, asynchronous background processes like order processing) using both Web and Worker Roles
Apps that require advanced networkingCloud-based applications that require network isolation for use with Windows Azure Connect or Windows Azure Virtual Network
Porting existing line of business appsChoose an image from the library or upload your own VHD.
Enterprise server applicationsRun your existing enterprise applications in the cloud, such as SQL Server, SharePoint Server or Active Directory.
Windows or Linux operating system Support for Windows Server, along with community and commercial versions of Linux. Connect virtual machines with cloud services to take full advantage of PaaS services.
Virtual Machines
Cloud Service Overview
What is a Cloud Service?
A collection of related service roles
Web Role Worker Role
What Can It Run?
Web Role and Worker Role
Windows Server (+ IIS 7, 7.5 or IIS 8.0* for Web Role)ASP.NET 3.5 SP1, 4.0 or 4.5* – 64bitHostsWebforms or MVCFastCGI applications (e.g. PHP)
Http(s)Web/Worker HybridCan optionally implement RoleEntryPoint
*for Windows Server 2012
Worker Role Patterns
Queue Polling WorkerPush and Pop Messages within while(true) loopE.g. Map/Reduce pattern, background image processing
Listening Worker RoleCreate TcpListener or WCF Service HostE.g. Run a .NET SMTP server or WCF Service
External Process Worker RoleOnStart 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
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:Virtual machine sizeCommunication endpointsLocal storage resourcesetc.
Roles and Instances
Instance
Role
Environment
Deployment (anton.cloudapp.net)
Hosted Service
Production
Web Role 1
Web 1 Instance
0
Web 1 Instance
1
Web 1 Instance
2
Web Role 2
Web 2 Instance
0
Worker Role 1
Worker 1 Instance
0
Worker 1 Instance
1
Staging
6 × VM
Cloud Service Availability
Fault Domains
99.95% Uptime GuaranteeRequires 2 or more instance per role
Role instance are isolated by fault domainFault domains isolate VMsFault domains provide redundancyAt least two fault domains per role
Roles and InstancesExample role with nine virtual machines distributed across three fault domains
ROLE
VM1 VM3
VM5 VM8
VM2 VM4
VM6 VM9
VM6 VM9
Fault Domain
Rack
Fault and Update DomainsFault Domain
Rack
INSTANCE
INSTANCE
INSTANCE
INSTANCE
INSTANCE
INSTANCE
INSTANCE
INSTANCE
UD #1
UD #1
UD #2
UD #2
Cloud Service Lifecycle
Understanding Packaging and ConfigWindows Azure Services are described by two 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)
Role Lifecycle
All roles may extend RoleEntryPointRoles report status via RoleEnvironment
StatusCheck
StatusCheck
StatusCheck
Stopping
METHODS EVENTS STATUS
Upload to Windows Azure
Packaging & Deployment
Microsoft Visual Studio
Web Role
Worker Role
Cloud ServiceCommunication
Cloud Service – inter-role communicationInput Endpoint• Load-balanced• HTTP/HTTPS/TCP/UDP
Internal Endpoint• Not load-balanced• HTTP/TCP/UDP/ANY
Instance Input Endpoint• Route traffic to specific instance based on port• TCP/UPD
Other options• Queue• Storage• Database• …
Azure Cloud ServicesDemo