Upload
shiju-varghese
View
457
Download
2
Embed Size (px)
DESCRIPTION
Building Windows Azure Cloud Services App with Web Role, Worker Role, Table Storage and Service Bus
Citation preview
Windows Azure Cloud Services – Web Roles & Worker Roles
Shiju Varghesehttps://github.com/shijuvar
Technical Architect, Marlabs
Agenda
Agenda
Introduction to Windows Azure Cloud Services
Building Multi-Tier Cloud App with Web Role and Worker Role
Windows Azure Execution Models
Virtual Machines
Web SitesCloud
Services
Cloud Service
A container of related service roles
Web Role Worker Role
Web Role & Worker Role
Web Role: A web role provides a dedicated Internet Information Services (IIS) web-server used for hosting front-end web applications.
Worker Role: Applications hosted within worker roles can run asynchronous, long-running or never-ending tasks independent of user interaction or input.
What Can It Run
Cloud Service Components
Service Definition File Service Definition File (.csdef) defines the service model, including the number of
roles Defines Roles, Ports, Certificates, Configuration Settings, Startup Tasks, IIS
Configuration, and more… Can only be changed by upgrades or new deployments
Service Configuration File The cloud service configuration file (.cscfg) provides configuration settings for
the cloud service and individual roles, including the number of role instances. Can be updated any time through Portal or API
Service Package The service package (.cspkg) contains the application code and the service
definition file.
Service Definition<?xml version="1.0" encoding="utf-8"?><ServiceDefinition name="AzureCloudServices" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-10.1.8"> <WebRole name="AzureCloudServices.Web" vmsize="Small"> <Sites> <Site name="Web"> <Bindings> <Binding name="Endpoint1" endpointName="Endpoint1" /> </Bindings> </Site> </Sites> <Endpoints> <InputEndpoint name="Endpoint1" protocol="http" port="80" /> </Endpoints> <Imports> <Import moduleName="Diagnostics" /></Imports> <ConfigurationSettings> <Setting name="StorageConnectionString" /> </ConfigurationSettings> </WebRole> <WorkerRole name="AzureCloudServices.Worker" vmsize="Small"> <Imports> <Import moduleName="Diagnostics" /></Imports> <ConfigurationSettings> <Setting name="StorageConnectionString" /> </ConfigurationSettings> </WorkerRole></ServiceDefinition>
Service Configuration<ServiceConfiguration serviceName="AzureCloudServices" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="3" osVersion="*" schemaVersion="2012-10.1.8"> <Role name="AzureCloudServices.Web"> <Instances count="1" /> <ConfigurationSettings> <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" /> <Setting name="StorageConnectionString" value="UseDevelopmentStorage=true" /> <Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" /> </ConfigurationSettings> <Certificates> <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="8A15A39839FD2B844015A7585393C6FB189435FB" thumbprintAlgorithm="sha1" /> </Certificates> </Role> <Role name="AzureCloudServices.Worker"> <Instances count="1" /> <ConfigurationSettings> <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" /> <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" /> <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="shijuvar" /> <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="2014-04-28T23:59:59.0000000+05:30" /> <Setting name="StorageConnectionString" value="UseDevelopmentStorage=true" /> </ConfigurationSettings> <Certificates> <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="8A15A39839FD2B844015A7585393C6FB189435FB" thumbprintAlgorithm="sha1" /> </Certificates> </Role></ServiceConfiguration>
Role Programming Model
Inherits RoleEntryPoint
OnStart() Method
Run() Method
OnStop() Method
Windows Azure SDKs and Tools
.NetVisual Studio ToolsClient Libraries for .Net
Node.jsPowerShell ToolsNode.js for WindowsIISNodeClient Libraries for Node.jsWindows Azure CLI
JavaEclipse ToolsClient Libraries for Java
phpCommand Line ToolsClient Libraries for php
Demo – Multi-Tier Cloud App with Web Role and Worker Role
Blog Post & Source Code for the Demo App
Source Code - https://github.com/shijuvar/AzureCloudServices
Blog Post - http://tinyurl.com/azurekochi
Questions?
THANKS
http://weblogs.asp.net/shijuvarghese
https://github.com/shijuvar