2

I'm using the Windows Azure PowerShell Cmdlets v0.6.7 from here: https://www.windowsazure.com/en-us/manage/downloads/

When I run the following command:

Move-AzureDeployment -ServiceName $AzureServiceName

I get the following error:

Move-AzureDeployment : There was no endpoint listening at https://management.core.windows.net/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/services/hostedservices/xxxxxxxxxxxxxxx/deploymentslots/Production that could accept the message.

The error is somewhat correct, there is only a deployment in my Staging slot. However, the documentation for Move-AzureDeployment (http://msdn.microsoft.com/en-us/library/windowsazure/jj152834.aspx) states:

If there is a deployment in the staging environment and no deployment in the production environment, the deployment will move to production.

The preceding Azure PowerShell Cmdlets in the same script, such as New-AzureDeployment, execute successfully. I start the script by using Set-AzureSubscription to configure the subscription info and certificate.

Not sure what I'm missing, any help is appreciated, thanks!

4

3 回答 3

2

我也遇到了这个问题,并求助于使用 REST API 进行交换。这是一个示例,以防有人感兴趣。

    $webRequest = [System.Net.WebRequest]::Create("https://management.core.windows.net/$global:SubscriptionId/services/hostedservices/$serviceName")

    $webRequestContent = ("<?xml version=""1.0"" encoding=""utf-8""?><Swap xmlns=""http://schemas.microsoft.com/windowsazure""><Production>{0}</Production><SourceDeployment>{1}</SourceDeployment></Swap>" -f $productionDeploymentName, $stagingDeploymentName)
    $webRequest.Method = "POST"
    $webRequest.ClientCertificates.Add($global:ManagementCertificate)
    $webRequest.ContentType = "application/xml"
    $webRequest.ContentLength = $webRequestContent.length
    $webRequest.Headers.Add("x-ms-version", "2012-03-01")
    $writer = New-Object System.IO.StreamWriter($webRequest.GetRequestStream())
    $writer.Write($webRequestContent)
    $writer.Close()

    $webResponse = $webRequest.GetResponse()
    WaitForDeploymentState $serviceName 'Production' 'Running'
    WaitForRoleInstancesState $serviceName 'Production' 'ReadyRole'
于 2013-01-02T01:18:05.010 回答
1

我认为有一个错误。我在这里创建了一个问题:

https://github.com/WindowsAzure/azure-sdk-tools/issues/785

于 2012-12-20T13:54:20.947 回答
0

当我遇到同样的问题时,我发现了这一点。

在我的脚本中,如果我想运行Move-AzureDeployment我首先检查生产槽,如果它有内容然后我切换(已经部署到脚本中的早期阶段)。

在 Production 为空的情况下,我将当前包重新部署到 Production Slot,我可以对其进行优化以使用 azure 存储,但今天就可以了。

简而言之; 文档错误或存在错误,如果 Production 为空,则无法使用此 cmdlet。

于 2012-12-19T00:09:06.103 回答