简体   繁体   中英

Windows Azure Powershell Deployment Error - “The remote server returned an unexpected response”

I'm following the latest February 2011 Azure Training Kit example.

I've successfully deployed using

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

Then running the next step -

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

Gives this error.

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

Can anyone suggest where I'm going wrong?

Found this link detailing same issue that doesn't have a resolution.

The example gives this information

Important : The Set-Deployment cmdlet assumes that the compute service and storage service names are the same. If this is not the case, specify an additional parameter -StorageServicename , replacing the placeholder with the name of the storage service name.

My storage service name does have the same name as the compute service, but adding that param made it work,

ie.

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  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM