Set-AzureServiceProjectRole

Sets the number of instances or the runtime version of a role.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

Set-AzureServiceProjectRole
   [-RoleName <String>]
   -Instances <Int32>
   [-PassThru]
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
Set-AzureServiceProjectRole
   [-RoleName <String>]
   -Runtime <String>
   -Version <String>
   [-PassThru]
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
Set-AzureServiceProjectRole
   [-RoleName <String>]
   [-PassThru]
   -VMSize <String>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]

Description

This topic describes the cmdlet in the 0.8.10 version of the Microsoft Azure PowerShell module. To get the version of the module you're using, in the Azure PowerShell console, type (Get-Module -Name Azure).Version.

The Set-AzureServiceProjectRole cmdlet sets the number of role instances for the specified role.

Examples

Example 1: Set instances for a web role

PS C:\> Set-AzureServiceProjectRole "MyWebRole" 2

Sets the number of instances for the web role named MyWebRole1 to 2.

Example 2: Set instances for a worker role

PS C:\> Set-AzureServiceProjectRole "MyWorkerRole1" 2

Sets the role instance count for the worker role named WorkerRole1 to 2.

Example 3: Set the runtime version for a role service

PS C:\> Set-AzureServiceProjectRole "MyRole1" node 0.6.20

Sets the node.exe runtime version for role MyRole1 to 0.6.20.

Parameters

-Instances

Specifies the number of role instances for the specified web or worker role.

Type:Int32
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Type:AzureSMProfile
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RoleName

Specifies the name of the web or worker role to be changed.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Runtime

Specifies the runtime to add to the specified role.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Version

Specifies the version of the runtime to add to the role.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VMSize

Specifies the virtual machine size of the role.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

Specifies the size of the virtual machine.