15
Windows Azure Cloud Services – Web Roles & Worker Roles Shiju Varghese https://github.com/ shijuvar Technical Architect, Marlabs

Windows Azure Cloud Services

Embed Size (px)

DESCRIPTION

Building Windows Azure Cloud Services App with Web Role, Worker Role, Table Storage and Service Bus

Citation preview

Page 1: Windows Azure Cloud Services

Windows Azure Cloud Services – Web Roles & Worker Roles

Shiju Varghesehttps://github.com/shijuvar

Technical Architect, Marlabs

Page 2: Windows Azure Cloud Services

Agenda

Agenda

Introduction to Windows Azure Cloud Services

Building Multi-Tier Cloud App with Web Role and Worker Role

Page 3: Windows Azure Cloud Services

Windows Azure Execution Models

Virtual Machines

Web SitesCloud

Services

Page 4: Windows Azure Cloud Services

Cloud Service

A container of related service roles

Web Role Worker Role

Page 5: Windows Azure Cloud Services

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.

Page 6: Windows Azure Cloud Services

What Can It Run

Page 7: Windows Azure Cloud Services

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.

Page 8: Windows Azure Cloud Services

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>

Page 9: Windows Azure Cloud Services

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>

Page 10: Windows Azure Cloud Services

Role Programming Model

Inherits RoleEntryPoint

OnStart() Method

Run() Method

OnStop() Method

Page 11: Windows Azure Cloud Services

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

Page 12: Windows Azure Cloud Services

Demo – Multi-Tier Cloud App with Web Role and Worker Role

Page 13: Windows Azure Cloud Services

Blog Post & Source Code for the Demo App

Source Code - https://github.com/shijuvar/AzureCloudServices

Blog Post - http://tinyurl.com/azurekochi

Page 14: Windows Azure Cloud Services

Questions?

Page 15: Windows Azure Cloud Services

THANKS

http://weblogs.asp.net/shijuvarghese

https://github.com/shijuvar