2012-11-19 31 views
2

我使用的是从这里开始的Windows Azure PowerShell命令v0.6.7:https://www.windowsazure.com/en-us/manage/downloads/布展AzureDeployment PowerShell命令失败

当我运行下面的命令:

Move-AzureDeployment -ServiceName $AzureServiceName 

我得到以下错误:

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. 

错误是有点正确的,在我的Staging插槽只有一个部署。然而,对于移动-AzureDeployment的文件(http://msdn.microsoft.com/en-us/library/windowsazure/jj152834.aspx)规定:

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

前述天青PowerShell命令在同一脚本,如New-AzureDeployment,成功执行。我通过使用Set-AzureSubscription来启动脚本来配置订阅信息和证书。

不知道我错过了什么帮助表示感谢,谢谢!

回答

0

我在遇到同样的问题时发现了这个问题。

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

在生产为空的情况下,我将当前包重新部署到生产槽,我可以优化它以使用天蓝色存储,但它会在今天完成。

总之;文档错误或存在错误,如果Production为空,则不能使用此cmdlet。

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' 
+2

作为唯一一个偶然的Powershell用户,这不是明显对我如何加载证书。我最终解决了这个问题。我希望我能在一段时间内挽救他人的阅读。您可以使用:$ global:ManagementCertificate = gci cert:\ CurrentUser \ My \ 其中是证书指纹。这假定证书已安装在您的个人商店中。 –