Windows Azure Powershell部署错误 - “远程服务器返回了意外响应”

时间:2011-03-18 00:50:27

标签: powershell azure azure-deployment

我正在关注最新的2011年2月Azure培训套件示例。

我已成功部署

New-Deployment -serviceName xxxxmytodo99 
                   -subscriptionId cxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 
                   -certificate (get-item cert:\CurrentUser\MY\xxxxxxxxxxxx)
                   -slot staging 
                   -package MyTodo.cspkg
                   -configuration ServiceConfiguration.cscfg 
                   -label "v2.0" 
                   -storageServiceName xxxxmytodo99

然后运行下一步 -

Get-HostedService -serviceName xxxxmytodo99
                  -subscriptionId cxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 
                  -certificate (get-item cert:\CurrentUser\MY\xxxxxxxxxxxx) 
    | Get-Deployment staging 
    | Set-Deployment -package MyTodo.cspkg 
                     -configuration ServiceConfiguration.cscfg 
                     -label "v2.1" 
    | Get-OperationStatus -WaitToComplete

给出了这个错误。

Set-Deployment : The remote server returned an unexpected response: (400) Bad Request.
At line:1 char:232
+ Get-HostedService -serviceName xxxxmytodo99 -subscriptionId cxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  -certificate (get-item cert:\CurrentUser\MY\xxxxxxxxxxxx) | Get-Deployment staging | Set-Deployment <<<<  -package MyTodo.cspkg -configuration ServiceConfiguration.cscfg -label "v2.2" | Get-OperationStatus -WaitToComplete
    + CategoryInfo          : CloseError: (:) [Set-Deployment], ProtocolException
    + FullyQualifiedErrorId : Microsoft.Samples.AzureManagementTools.PowerShell.HostedServices.SetDeploymentCommand

有谁可以建议我哪里出错了?

发现this link详细说明了没有解决方案的相同问题。

1 个答案:

答案 0 :(得分:4)

该示例提供了此信息

  

重要:Set-Deployment cmdlet   假定计算服务和   存储服务名称是相同的。如果   事实并非如此,请注明   附加参数   -StorageServicename,   用。替换占位符   存储服务名称的名称。

我的存储服务名称与计算服务的名称相同,但添加该参数使其工作,

Get-HostedService -serviceName xxxxmytodo99 
                  -subscriptionId cxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 
                  -certificate (get-item cert:\CurrentUser\MY\xxxxxxxxxxxx) 
        | Get-Deployment staging
        | Set-Deployment -package MyTodo.cspkg 
                         -configuration ServiceConfiguration.cscfg 
                         -storageServiceName xxxxmytodo99 
                         -label "v2.2" 
    | Get-OperationStatus -WaitToComplete