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
Publish-AzureServiceProject
[-ServiceName <String>]
[-StorageAccountName <String>]
[-Location <String>]
[-Slot <String>]
[-Launch]
[-AffinityGroup <String>]
[-DeploymentName <String>]
[-ForceUpgrade]
[-Profile <AzureSMProfile>]
[<CommonParameters>]
Publish-AzureServiceProject
[-Package <String>]
-Configuration <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.
Type: | String |
Aliases: | ag |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Configuration
Specifies the service configuration file. If you specify this parameter, specify the Package parameter.
Type: | String |
Aliases: | cc |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DeploymentName
Specifies the deployment name.
Type: | String |
Aliases: | dn |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ForceUpgrade
Type: | SwitchParameter |
Aliases: | f |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Required: | False |
Accept pipeline input: | True |
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 |
Required: | False |
Accept pipeline input: | True |
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 |
Required: | False |
Accept pipeline input: | True |
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 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 |
Required: | False |
Accept pipeline input: | True |
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 |
Required: | False |
Accept pipeline input: | True |
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 |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |