Publish-​Azure​Service​Project

Publish the current service to Windows Azure.

Syntax

Publish-AzureServiceProject
       [-AffinityGroup <String>]
       -Configuration <String>
       [-DeploymentName <String>]
       [-ForceUpgrade]
       [-Launch]
       [-Location <String>]
       [-Package <String>]
       [-Profile <AzureSMProfile>]
       [-Slot <String>]
       [-StorageAccountName <String>]
       [<CommonParameters>]
Publish-AzureServiceProject
       [-AffinityGroup <String>]
       [-DeploymentName <String>]
       [-ForceUpgrade]
       [-Launch]
       [-Location <String>]
       [-Profile <AzureSMProfile>]
       [-ServiceName <String>]
       [-Slot <String>]
       [-StorageAccountName <String>]
       [<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.

Required Parameters

-Configuration

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

Type:String
Aliases:cc
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-AffinityGroup

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

Type:String
Aliases:ag
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-DeploymentName

Specifies the deployment name.

Type:String
Aliases:dn
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ForceUpgrade
Type:SwitchParameter
Aliases:f
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Launch

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

Type:SwitchParameter
Aliases:ln
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters: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.

Type:String
Aliases:l
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters: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.

Type:String
Aliases:sp
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:False
Accept wildcard characters: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).

Type:String
Aliases:sv
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters: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.

Type:String
Aliases:sl
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters: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.

Type:String
Aliases:st
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False