Edit

Share via


Publish-AzureServiceProject

Publish the current service to Windows Azure.

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

PublishFromServiceDefinition (Default)

Publish-AzureServiceProject
    [-ServiceName <String>]
    [-StorageAccountName <String>]
    [-Location <String>]
    [-Slot <String>]
    [-Launch]
    [-AffinityGroup <String>]
    [-DeploymentName <String>]
    [-ForceUpgrade]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

PublishFromPackage

Publish-AzureServiceProject
    -Configuration <String>
    [-Package <String>]
    [-StorageAccountName <String>]
    [-Location <String>]
    [-Slot <String>]
    [-Launch]
    [-AffinityGroup <String>]
    [-DeploymentName <String>]
    [-ForceUpgrade]
    [-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 Publish-AzureServiceProject cmdlet publishes the current service to the cloud. You can specify publishing configuration (such as Subscription, StorageAccountName, Location, Slot) on the command line, or in local settings through the Set-AzureServiceProject cmdlet.

Examples

Example 1: Publish a service project with default values

PS C:\> Publish-AzureServiceProject

This example publishes the current service, using the current service settings and the current Azure publish profile.

Example 2: Create a deployment package

PS C:\> Publish-AzureServiceProject -PackageOnly

This example creates a deployment package (.cspkg) file in the service directory and does not publish to Windows Azure.

Parameters

-AffinityGroup

Specifies the affinity group that you want the service to use.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ag

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Configuration

Specifies the service configuration file. If you specify this parameter, specify the Package parameter.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cc

Parameter sets

PublishFromPackage
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-DeploymentName

Specifies the deployment name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:dn

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ForceUpgrade

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 Publish-AzureServiceProject cmdlet publishes the current service to the cloud. You can specify publishing configuration (such as Subscription, StorageAccountName, Location, Slot) on the command line, or in local settings through the Set-AzureServiceProject cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:f

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Launch

Opens a browser window so you can view the application after it is deployed.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ln

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Location

The region in which the application will be hosted. Possible values are:

  • Anywhere Asia
  • Anywhere Europe
  • Anywhere US
  • East Asia
  • East US
  • North Central US
  • North Europe
  • South Central US
  • Southeast Asia
  • West Europe
  • West US

If no Location is specified, the location specified in the last call to Set-AzureServiceProject will be used. If no Location was ever specified, the Location will be randomly chosen from 'North Central US' and 'South Central US' locations.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:l

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Package

Specifies the package file to deploy. Specify either a local file that has the .cspkg file name extension or a URI of a blob that contains the package. If you specify this parameter, do not specify the ServiceName parameter.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:sp

Parameter sets

PublishFromPackage
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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.

Parameter properties

Type:AzureSMProfile
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ServiceName

Specifies the name to be used for the service when publishing to Windows Azure. The name determines part of the label in the cloudapp.net subdomain that is used to address the service when hosted in Windows Azure (that is, name.cloudapp.net). Any name specified while publishing the service overrides the name given when the service was created. (See the New-AzureServiceProject cmdlet).

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:sv

Parameter sets

PublishFromServiceDefinition
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Slot

The deployment slot to be used for this service. Possible values are 'Staging' and 'Production'. If no slot is specified, the slot provided in the last call to Set-AzureDeploymentSlot is used. If no slot has ever been specified, the 'Production' slot is used.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:sl

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-StorageAccountName

Specifies the Windows Azure storage account name to be used while publishing the service. This value is not used until the service is published. When this parameter is not specified, the value is obtained from the last Set-AzureServiceProject command. If no storage account was ever specified, a storage account matching the name of the service will be used. If no such storage account exists, the cmdlet attempts to create a new one. However, the attempt may fail if a storage account matching the service name exists in another subscription.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:st

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.