Set-AzureDeployment - ProtocolException

6
安装了Windows Azure Powershell(2012年10月版本0.6.7)后,运行Set-AzureDeployment Cmdlet时出现错误。
将相同的参数提供给Remove-AzureDeployment和New-AzureDeployment可以正常工作。 Remove-AzureDeployment -Slot $slot -ServiceName $serviceName -Force New-AzureDeployment -Slot $slot -Package $packageLocation -Configuration $cloudConfigLocation -label $deploymentLabel -ServiceName $serviceName 但是,在使用带有-Upgrade开关的Set-AzureDeployment并使用上述相同参数值时,我会收到错误提示。 Set-AzureDeployment -Upgrade -Slot $slot -Package $packageLocation -Configuration $cloudConfigLocation -label $deploymentLabel -ServiceName $serviceName -Force 错误是:
+ CategoryInfo:CloseError:(:) [Set-AzureDeployment],ProtocolException
+ FullyQualifiedErrorId:Microsoft.WindowsAzure.Management.ServiceManagement.HostedServices.SetAzureDeploymentCommand
捕获内部异常显示:
<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>

有人可以提供建议,说明可能出了什么问题吗?

我尝试运行的脚本是从这里获取的PublishCloudService.ps1。

3个回答

4

我曾遇到过与2012年10月版本的cmdlets相同的问题。 我向支持部门打开了一个支持工单,他们指出这是一个已知问题,并指向八月版本以解决错误 - https://github.com/WindowsAzure/azure-sdk-tools/downloads。 卸载十月版本并安装八月版本后,部署按预期工作。


微软已将此问题确认为错误,希望能在下一个版本中解决。您可以在这里跟踪错误的进展:https://github.com/WindowsAzure/azure-sdk-tools/issues/603 - charlie.mott

2
我在Azure PowerShell方面还是新手,但我也遇到了类似的问题,我通过以下方法解决:
  1. 将插槽设置为staging
  2. 如果存在当前部署,则删除它
  3. 创建一个新的部署
  4. 进行交换
这是我的PowerShell脚本(修改自: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

它正在工作 :)


1
我遇到了类似的问题。当我将cspkg单独上传到Blob存储,并使用-Package {url-to-blob}进行引用时,升级就成功了。
我猜这可能意味着由于某些设置不正确,它无法上传Blob本身,但很难确定是什么问题。
你是如何捕获内部异常的?

我按照这篇博客指南捕获了内部异常: 捕获内部异常: http://blogs.msdn.com/b/benjguin/archive/2012/07/03/windows-azure-powershell-the-remote-server-returned-an-unexpected-response-400-bad-request.aspx - charlie.mott

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接