New-AzureDeployment

Creates a deployment from a service.

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.

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

New-AzureDeployment
   [-ServiceName] <String>
   [-Package] <String>
   [-Configuration] <String>
   [-Slot] <String>
   [[-Label] <String>]
   [[-Name] <String>]
   [-DoNotStart]
   [-TreatWarningsAsError]
   [-ExtensionConfiguration <ExtensionConfigurationInput[]>]
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]

Description

The New-AzureDeployment cmdlet creates an Azure deployment from a service that comprises web roles and worker roles. This cmdlet creates a deployment based on a package file (.cspkg) and a service configuration file (.cscfg). Specify a name that is unique within deployment environment.

Use the New-AzureVM cmdlet to create a deployment based on Azure virtual machines.

Examples

Example 1: Create a deployment

PS C:\> New-AzureDeployment -ServiceName "ContosoService" -Slot "Production" -Package "https://contosostorage.blob.core.windows.net/container06/ContosoPackage.cspkg" -Configuration "C:\packages\ContosoConfiguration.cscfg" -Label "ContosoDeployment"

This command creates a production deployment based on a package named ContosoPackage.cspkg and a configuration named ContosoConfiguration.cscfg. The command specifies a label for the deployment. It does not specify a name. This cmdlet creates a GUID as the name.

Example 2: Create a deployment based on an extension configuration

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

This command creates a production deployment based on a package and configuration. The command specifies an extension configuration named ContosoExtensionConfig.cscfg. This cmdlet creates GUIDs as the name and the label.

Parameters

-Configuration

Specifies the full path of a service configuration file.

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

-DoNotStart

Specifies that this cmdlet does not start the deployment.

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

-ExtensionConfiguration

Specifies an array of extension configuration objects.

Type:ExtensionConfigurationInput[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
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 name for the deployment. If you do not specify a label, this cmdlet uses a GUID.

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

-Name

Specifies a deployment name. If you do not specify a name, this cmdlet uses a GUID.

Type:String
Aliases:DeploymentName
Position:5
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Package

Specifies the path or URI of a .cspkg file in storage within the same subscription or project.

Type:String
Position:1
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

-ServiceName

Specifies the name of the Azure service for the deployment.

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

-Slot

Specifies the environment where this cmdlet creates the deployment. Valid values are: Staging and Production. The default value is Production.

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

-TreatWarningsAsError

Specifies that warning messages are errors. If you specify this parameter, a warning message causes the deployment to fail.

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