Professional Documents
Culture Documents
AZURE COMPUTE
FSOFT SOLUTION BOARD
January 8, 2014
PAAS
CLOUD
PROVIDER
DEVELOPER
PROGRAM
Measured service
4. Program (hosted in cloud)
use resources
DEFINITION
MAIN COMPONENTS:
CURRENT VERSION
Windows Azure
Datacenter
Fabric
Hypervisor
Hardware
Microsoft
manages every
underlying detail
for you
Copyright 2011 FPT Software
THIS LECTURE
Web Sites vs Cloud Services vs Virtual
Machines
How an Azure application works
Azure Roles and Instances
Service Definition and Configuration Files
Azure Compute Emulator
Compute Libraries and Classes
Copyright 2011 FPT Software
You manage
IaaS
PaaS
SaaS
Application
Application
Application
Application
Data
Data
Data
Data
Runtime
Runtime
Runtime
Runtime
Middleware
Middleware
Middleware
Middleware
OS
OS
OS
OS
Virtualization
Virtualization
Virtualization
Virtualization
Server
Server
Server
Server
Storage
Storage
Storage
Storage
Networking
Networking
Networking
Networking
Provider manage
Normal
Software
VIRTUAL MACHINE
IaaS in Azure, based on IIS
Developer register for a virtual machine and prepare
the underlying OS and applications: OS disk and Data
disk
Can use template virtual hard disk (vhd) in gallery or
upload own vhd
Persistent storage: Store and backup vhd image in
Azure Blob Storage
Support both Linux and Windows
Copyright 2011 FPT Software
10
VIRTUAL MACHINE
11
VIRTUAL MACHINE
CONNECTIVITY
Can join Virtual Network
Can use Azure Connect
Can open up endpoints to connect with other
roles and applications
Can use Remote Desktop Connection
12
WEB SITES
A cloud hosting service for Web Sites (SaaS)
Allow creation and deployment of Web Sites
in seconds
Support ASP, ASP.NET, PHP, Node.js
Support opensource like Joomla, Wordpress,
Drupal, DotNetNuke
Support shared and reserved instance
Dashboard and management tools
Copyright 2011 FPT Software
13
WEB SITES
14
COMPARISON
15
16
AN AZURE APPLICATION
AZURE
DEVELOPER
WINDOWS
AZURE
RESOURCE
Measured service
4. Program (hosted in Azure)
runs and uses further Azure
resources from pool
17
AN AZURE APPLICATION
High availability: Your application run as much
as possible (with the resources you have) and
respond to request
Scalability: You can easily and dynamically
change the number of VMs
Manageability: Azure manages the
infrastructure and platform for you and give
you tools and libraries to monitor your
applications
Copyright 2011 FPT Software
18
19
20
AN ANALOGY
Azure: The Coach
A role: Forward, Midfielder, Goalkeeper
Two type of roles: Web (attacking) and Worker
(defending)
Resource of role: Dribbling, shooting,
Your application: The match
21
22
23
24
AZURE ROLES
25
AZURE ROLES:
WEB ROLES
Underlying Guest-OS has IIS 7.0 installed and
customized
Web Roles run in IIS
Azure automatically deploys your Web Roles
to the IIS. You dont work with the OS
Suitable for web-based frontend
Unsuitable for running background processes
26
AZURE ROLES:
WORKER ROLES
Underlying Guest-OS has IIS disabled
Worker Roles doesnt accept inbound
connections by default
Azure automatically deploys your Worker
Roles in a Windows Azure process
Useful for general development
Often served as background processing for a
Web Role
Copyright 2011 FPT Software
27
AZURE ROLES:
HOW TO USE WEB & WORKER
28
AZURE ROLES:
CONFIGURATION
Virtual
Machine
Size
CPU
Cores
ExtraSmall
Shared 768 MB
Small
1.75 GB
229,400 MB (6,144 MB is
reserved for system files)
165 GB
100
Medium
3.5 GB
500,760 MB (6,144 MB is
reserved for system files)
340 GB
200
Large
7 GB
1,023,000 MB (6,144 MB is
reserved for system files)
850 GB
400
ExtraLarge
14 GB
2,087,960 MB (6,144 MB is
reserved for system files)
1890 GB
800
Memory
29
30
AZURE ROLES:
CONFIGURATION
How to request a specific VM Size: Azure
configuration file
Include as a part of the deployment package
Can change the number of instances without
stopping the application
Can change the VM size of a role without
rebuilding the application
31
AZURE ROLE:
FILES
The Website that runs in the web
role WebRoleOne
Specific code to manage the web
role lifecycle, inherits
RoleEntryPoint Class
Setting for the web role
Configuration file for the whole
Azure deployment (has Cloud
and Local version)
Definition file for the whole
Azure deployment
Copyright 2011 FPT Software
32
33
34
35
36
NOTICE
Managing your Azure applications will mainly
require tweaking the definition and
configuration files.
37
WEBROLE.CS
The WebRole.cs file is automatically generated
when you create a Cloud Service Project and
add in one of the Web Role variants;
However, if you associate an existing ASP.NET
application as a web role the additional file
isnt generated for you
Extends the RoleEntryPoint class, a part of the
Azure service runtime used to start, run, and
stop your roles in the cloud
Copyright 2011 FPT Software
38
WEBROLE.CS
namespace WebRole1
{
public class WebRole : RoleEntryPoint
{
public override bool OnStart()
{
return base.OnStart();
}
}
}
39
WORKERROLE.CS
The WorkerRole.cs file is automatically
generated when you create a Cloud Service
Project and add in one of the Web Role
variants
A Worker Role requires the WorkerRole.cs file
to run
Extends the RoleEntryPoint class, a part of the
Azure service runtime used to start, run, and
stop your roles in the cloud
Copyright 2011 FPT Software
40
WORKERROLE.CS
namespace WorkerRole1
{
public class WorkerRole : RoleEntryPoint
{
public override void Run()
{
Trace.WriteLine("$projectname$ entry point called", "Information");
while (true)
{
Thread.Sleep(10000);
Trace.WriteLine("Working", "Information");
}
}
public override bool OnStart()
{
ServicePointManager.DefaultConnectionLimit = 12;
return base.OnStart();
}
}
}
41
ROLEENTRYPOINT CLASS
Library: Microsoft.WindowsAzure.ServiceRuntime
Worker roles must extend the RoleEntryPoint class
to add functionality to the role instances.
Web roles can optionally extend
the RoleEntryPoint class, or can use the ASP.NET
lifecycle management methods to handle the start
and stop sequences.
For a VM role, Windows Services (provided in the
adapter) are used instead of the RoleEntryPoint class
Copyright 2011 FPT Software
42
ROLEENTRYPOINT CLASS
Methods:
OnStart: Runs code that initializes a role instance
OnStop: Runs code when a role instance is to be
stopped
Run: Runs code that is intended to be run for the life
of the role instance.
43
44
COMPUTE EMULATOR
VS REAL AZURE
COMPUTE EMULATOR
No Access
Role instances run with Administrator privileges Role instances run as standard User Account
Does not fully support load balancer
No limit
Use IIS 7
Can not
45
46
SUMMARY
Web Sites vs Cloud Services vs Virtual
Machines
How an Azure application works
Azure Roles and Instances
Service Definition and Configuration Files
Azure Compute Emulator
Compute Libraries and Classes
Copyright 2011 FPT Software
47