Set-AzureDeployment

Modifies the status, configuration settings, or upgrade mode of a deployment.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Service Management APIs. See the Az PowerShell module for cmdlets to manage Azure Resource Manager resources.

Important

Cloud Services (classic) is now deprecated for new customers and will be retired on August 31st, 2024 for all customers. New deployments should use the new Azure Resource Manager based deployment model Azure Cloud Services (extended support).

Syntax

Set-AzureDeployment
   [-Upgrade]
   [-ServiceName] <String>
   [-Package] <String>
   [-Configuration] <String>
   [-Slot] <String>
   [[-Mode] <String>]
   [[-Label] <String>]
   [[-RoleName] <String>]
   [-Force]
   [[-ExtensionConfiguration] <ExtensionConfigurationInput[]>]
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
Set-AzureDeployment
   [-Config]
   [-ServiceName] <String>
   [-Configuration] <String>
   [-Slot] <String>
   [[-ExtensionConfiguration] <ExtensionConfigurationInput[]>]
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
Set-AzureDeployment
   [-Status]
   [-ServiceName] <String>
   [-Slot] <String>
   [-NewStatus] <String>
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]

Description

The Set-AzureDeployment cmdlet modifies the status, configuration settings, or upgrade mode of an Azure deployment. You can change the status of the deployment to either Running or Suspended. You can change the .cscfg file for the deployment. You can set the upgrade mode and update configuration files. Use the Set-AzureWalkUpgradeDomain cmdlet to initiate an upgrade.

Examples

Example 1: Change the status of a deployment

PS C:\> Set-AzureDeployment -Status -ServiceName "ContosoService" -Slot "Production" -NewStatus "Running"

This command sets the status of the deployment for the service named ContosoService in the production environment to Running.

Example 2: Assign a different configuration file to a deployment

PS C:\> Set-AzureDeployment -Config -ServiceName "ContosoService" -Slot "Staging" -Configuration "C:\Temp\MyServiceConfig.Cloud.csfg"

This command assigns a different configuration file for the deployment for the service named ContosoService in the staging environment.

Example 3: Set the upgrade mode to Auto

PS C:\> Set-AzureDeployment -Upgrade -ServiceName "ContosoService" -Mode Auto -Package "C:\packages\ContosoApp.cspkg" -Configuration "C:\Config\ContosoServiceConfig.Cloud.csfg"

This command sets the upgrade mode to Auto, and specifies an upgrade package and a new configuration file.

Example 4: Install extension configuration in a service

PS C:\> Set-AzureDeployment -Config -ServiceName "ContosoService" -Mode "Automatic" -Package "https://contosostorage.blob.core.windows.net/container06/ContosoPackage.cspkg" -Configuration "C:\packages\ContosoConfiguration.cscfg" -Slot "Production" -ExtensionConfiguration "C:\packages\ContosoExtensionConfig.cscfg"

This command installs the extension configuration in the specified Cloud Service and applies them on roles.

Parameters

-Config

Specifies that this cmdlet modifies the configuration of the deployment.

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

-Configuration

Specifies the full path of a .cscfg configuration file. You can specify a configuration file for an upgrade or configuration change.

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

-ExtensionConfiguration

Specifies an array of extension configuration objects.

Type:ExtensionConfigurationInput[]
Position:9
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Force

Indicates that cmdlet performs a forced upgrade.

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

-InformationAction

Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InformationVariable

Specifies an information variable.

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

-Label

Specifies a label for the upgraded deployment.

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

-Mode

Specifies the mode of upgrade. Valid values are:

  • Auto
  • Manual
  • Simultaneous
Type:String
Position:5
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NewStatus

Specifies the target status for the deployment. Valid values are: Running and Suspended.

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

-Package

Specifies the full path of an upgrade package file.

Type:String
Position:2
Default value:None
Required:True
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 role to upgrade.

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

-ServiceName

Specifies the name of the Azure service of the deployment.

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

-Slot

Specifies the environment of the deployment to modify. Valid values are: Production and Staging.

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

-Status

Specifies that this cmdlet changes the status of the deployment.

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

-Upgrade

Specifies that this cmdlet upgrades the deployment.

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