Partilhar via


RoleInstance.UpdateDomain Property

 

Gets an integer value that indicates the update domain in which the role instance is running.

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

Syntax

public abstract int UpdateDomain { get; internal set; }
public:
property int UpdateDomain {
    virtual int get() abstract;
    internal: virtual void set(int value) abstract;
}
abstract UpdateDomain : int with get, internal set
Public MustOverride Property UpdateDomain As Integer
    Get
    Friend Set
End Property

Property Value

Type: System.Int32

Type: System.Int32

An integer value that represents the update domain in which the role instance is running.

Remarks

The update domain is related to the operation of upgrading a hosted service in the Azure Management Portal. When two or more role instances are running, they are assigned separate update domains (also referred to as an upgrade domain in the service model).

Azure upgrades one domain at a time, stopping the role instances running within the upgrade domain, upgrading them, bringing them back online, and moving on to the next domain. By stopping only the instances running within the current upgrade domain, Azure ensures that an upgrade takes place with the least possible impact to the running hosted service.

You can specify the number of upgrade domains to use in the ServiceDefinition.csdef file. The default number of upgrade domains is 5. For more information, see Azure Service Definition Schema

The following code example shows how to retrieve the upgrade domain in which role instances are running:

foreach (var role in RoleEnvironment.Roles) 
{
   foreach (var roleInstance in role.Value.Instances)      
   {
      Trace.WriteLine("Role instance update domain: " + roleInstance.UpdateDomain, "Information");
   }
}

See Also

RoleEnvironment
RoleInstance Class
Microsoft.WindowsAzure.ServiceRuntime Namespace

Return to top