Role.Name Property

 

Gets the name of the role as it is declared in the service definition file.

Namespace:   Microsoft.WindowsAzure.ServiceRuntime
Assembly:  Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)

public abstract string Name { get; internal set; }

Property Value

Type: System.String

Type: System.String

A String that contains the name of the role.

The following example shows how to retrieve the name of the role:

Trace.WriteLine("Role Name: " + RoleEnvironment.CurrentRoleInstance.Role.Name);
Return to top
Show: