Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set-AzureDeployment - ProtocolException

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.

like image 717
charlie.mott Avatar asked Nov 09 '12 18:11

charlie.mott


2 Answers

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.

like image 148
user1712707 Avatar answered Oct 04 '22 07:10

user1712707


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 :)

like image 22
Adiono Avatar answered Oct 04 '22 07:10

Adiono