6
votes

After installing Windows Azure Powershell (October 2012 version 0.6.7), I'm receiving errors running the Set-AzureDeployment Cmdlet.

Supplying the same parameters to the Remove-AzureDeployment and New-AzureDeployment works fine.

Remove-AzureDeployment -Slot $slot -ServiceName $serviceName -Force

New-AzureDeployment -Slot $slot -Package $packageLocation -Configuration $cloudConfigLocation -label $deploymentLabel -ServiceName $serviceName

However when using the Set-AzureDeployment with the -Upgrade switch and with the same parameter values above, I get an error.

Set-AzureDeployment -Upgrade -Slot $slot -Package $packageLocation -Configuration $cloudConfigLocation -label $deploymentLabel -ServiceName $serviceName -Force

The error is:

+ CategoryInfo : CloseError: (:) [Set-AzureDeployment], ProtocolException

+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.HostedServices.SetAzureDeploymentCommand

Catching the inner exception shows:

<Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Code>MissingOrIncorrectVersionHeader</Code><Message>The versioning header is not specified or was specified incorrectly.</Message></Error>

Can anyone offer advice as to what may be wrong?

The script I am attempting to run is the PublishCloudService.ps1 from here.

3

3 Answers

4
votes

I had had the same issue with October 2012 release of the cmdlets. Opened a support ticket with and they indicated it was a know issue and pointed me at the August release to get around the error - https://github.com/WindowsAzure/azure-sdk-tools/downloads. After uninstalling October build and installing August one the deployment started working as expected.

2
votes

I am new in AzurePowerShell things, but I have similar issue as well, I just trick it by:

  1. Set slot to staging
  2. Delete current deployment if exsist
  3. Create a new deployment one
  4. Swap it

This is my PowerShell scripts (modified from : http://weblogs.asp.net/srkirkland/archive/2012/09/11/ci-deployment-of-azure-web-roles-using-teamcity.aspx)

$subscription = "[Your Subscription Name]"
$service = "[Your Service Name]"
$slot = "staging" 
$package = "[Your Package File]"
$configuration = "[Your Config File]"
$timeStampFormat = "g"
$deploymentLabel = "ContinuousDeploy to $service v%build.number%"
$storageaccount = "[Your Storage Account Name]"

Write-Output "Running Azure Imports"
Import-Module "C:\Program Files (x86)\Microsoft SDKs\Windows   Azure\PowerShell\Azure\*.psd1"
Import-AzurePublishSettingsFile "[Your publishsettings file]"
Set-AzureSubscription -SubscriptionName $subscription -SubscriptionId "[Your   Subscription Id]" -CurrentStorageAccount $storageaccount
Set-AzureSubscription -DefaultSubscription $subscription

function Publish(){
 $deployment = Get-AzureDeployment -ServiceName $service -Slot $slot -ErrorVariable a -  ErrorAction silentlycontinue 

 if ($a[0] -ne $null) {
    Write-Output "$(Get-Date -f $timeStampFormat) - No deployment is detected. Creating  a new deployment. "
 }

 if ($deployment.Name -ne $null) {
    Write-Output "$(Get-Date -f $timeStampFormat) - Deployment exists in $servicename.   Upgrading deployment."
    Remove-AzureDeployment -Slot $slot -ServiceName $service -Force
 } 

 CreateNewDeployment
 Move-AzureDeployment -ServiceName $service
 }

function CreateNewDeployment()
{
    write-progress -id 3 -activity "Creating New Deployment" -Status "In progress"
    Write-Output "$(Get-Date -f $timeStampFormat) - Creating New Deployment: In   progress"

    $opstat = New-AzureDeployment -Slot $slot -Package $package -Configuration    $configuration -Label $deploymentLabel -ServiceName $service

    $completeDeployment = Get-AzureDeployment -ServiceName $service -Slot $slot
    $completeDeploymentID = $completeDeployment.deploymentid

    write-progress -id 3 -activity "Creating New Deployment" -completed -Status "Complete"
    Write-Output "$(Get-Date -f $timeStampFormat) - Creating New Deployment: Complete,    Deployment ID: $completeDeploymentID"
}

Write-Output "Create Azure Deployment"
Publish

And it's working :)

1
votes

I was getting a similar issue. When I uploaded the cspkg independently to blob storage, and referenced it with -Package {url-to-blob} then the upgrade worked.

I guess this might mean it was unable to upload the blob itself, because of some setting being wrong, but it's very hard to tell what that would be.

How did you capture the inner exception?