Represents a role that is defined as part of a hosted service.
Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)
Public MustInherit Class Role
The application that you develop runs as a hosted service in Windows Azure, and the application is built from one or more roles. A role defines a component that may run in the execution environment within Windows Azure. For more information about defining and configuring roles in the service model for a hosted service see, Setting Up a Hosted Service for Windows Azure. Roles that are defined for the hosted service run as role instances in Windows Azure.
The Role class is used to obtain role instance objects. The following code example shows how to retrieve the name of the role and the instance IDs of role instances:
No code example is currently available or this language may not be supported.
You can change the number of role instances that are running by changing the instances count in the ServiceConfiguration.csfg file. For more information about changing the instance count, see How to Scale Applications by Increasing or Decreasing the Number of Role Instances.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012