The architecture of a service hosted in Windows® Azure™ is based on discrete scalable components built with managed code. These components are termed roles.
A service hosted in Windows® Azure™ implements one or more roles. A service may run multiple instances of a role. Within Windows Azure, running instances of a role are replicated across multiple computers to implement all or part of the functionality of a service.
This topic contains the following subtopics:
Understanding Roles
About the Service Definition
About the Service Configuration
Understanding Roles
Windows Azure currently supports the following two types of roles:
-
Web role: A web role is a role that is customized for web application programming as supported by IIS 7 and ASP.NET.
-
Worker role: A worker role is a role that is useful for generalized development, and may perform background processing for a web role.
A service must include at least one role of either type, but may consist of any number of web roles or worker roles.
Role Execution
Windows Azure supports common language binaries targeted for the Any CPU platform defined by Microsoft .NET Framework 3.5 SP1. The roles that comprise a service execute in this environment.
Windows Azure enforces certain restrictions at runtime by using a combination of code access security and Windows NT security policies. Developers who are designing hosted services must take into account these additional restrictions.
Role Network Communication
A web role may define a single HTTP endpoint and a single HTTPS endpoint for external clients. A worker role may define any number of external endpoints using HTTP, HTTPS, or TCP. Each external endpoint defined for a role must listen on a unique port.
Web roles may communicate with other roles in a service via a single internal HTTP endpoint. Worker roles may define internal endpoints for HTTP or TCP.
Both web and worker roles can make outbound connections to Internet resources via HTTP or HTTPS and via Microsoft .NET APIs for TCP/IP sockets.
All roles may access the Windows Azure storage services via the REST APIs or the Windows Azure Storage Client Library.
Windows Azure Service Hosting Runtime Library
Roles have access to resources in the Windows Azure environment via the Windows Azure Service Hosting Runtime Library. See the Windows Azure Managed Library for more information.
About the Service Definition
The service model is determined by the service definition file. The service definition file defines the roles that comprise a service, optional local storage resources, configuration settings, and certificates for SSL endpoints.
The service definition can't be changed while the service is running in Windows Azure. To change the service model, you must upgrade the service using a VIP swap. See Performing Virtual IP Swap Upgrades for more information.
The service definition file has a default extension of .csdef. It is packaged with the role binaries when the service is packaged for deployment.
About the Service Configuration
The service configuration file sets values for the service that can be configured while the service is running in the fabric. The values you can specify in the service configuration file include the number of instances that you wish to deploy for each role, the values for the configuration parameters that you established in the service definition file, and the thumbprints for any SSL certificates associated with the service.
The service configuration file has a default extension of .cscfg. The service configuration file is not packaged with the service, but is uploaded to the Windows Azure fabric as a separate file. You can upload a new service configuration file without redeploying your service.
About the Service Package
The service package is the file that packages your role binaries and service definition file to be published to the Windows Azure fabric. You can package your service by using the CSPack Command-Line Tool.
After you have packaged your service, you can upload the service package file, together with the service configuration file, to the Windows Azure fabric by using the Windows Azure Developer Portal.
See Also