Windows Azure自动部署。 PowerShell脚本的问题

时间:2010-11-29 23:55:38

标签: deployment powershell azure

我正在使用Azure Management Cmdlets 1.0版。

我运行以下PowerShell脚本

New-Deployment -subscriptionId bef7722c-1a13-4c9f-b7f6-fafc0a958b35 -certificate D:\ pcg \ T.cer -serviceName 1ClickDeploymentTest -slot Production -package D:\ pcg

\ CloudTodorTest.cspkg -configuration D:\ pcg \ ServiceConfiguration.cscfg -label lbl1 -StorageServiceName TodorTestStorage

其中D:\ pcg \ T.cert是已经上传到Azure的证书。 包和配置是已在Azure上运行的应用程序的本地副本。 我试图手动部署它们并且它们正在工作。

执行此脚本后,我收到以下错误消息:

PS C:\ Windows \ SysWOW64 \ WindowsPowerShell \ v1.0> d:\ PSScripts \ dt2.ps1 新部署:远程服务器返回意外响应:(400)错误请求。 在D:\ PSScripts \ dt2.ps1:1 char:15 + New-Deployment<<<< -subscriptionId bef7722c-1a13-4c9f-b7f6-fafc0a958b35 -certificate D:\ pcg \ T.cer -serviceName 1Cli ckDeploymentTest -slot Staging -package D:\ pcg \ CloudTodorTest.cspkg -configuration D:\ pcg \ ServiceConfiguration.cscfg -l abel lbl1 -StorageServiceName TodorTestStorage | Get-OperationStatus -WaitToComplete     + CategoryInfo:CloseError:(:) [New-Deployment],ProtocolException     + FullyQualifiedErrorId:Microsoft.Samples.AzureManagementTools.PowerShell.HostedServices.NewDeploymentCommand

我可以执行其他cmdlet。例如,检查当前部署。

2 个答案:

答案 0 :(得分:3)

检查服务名称和部署槽以及您指定的其他参数的情况 - 我似乎记得服务名称必须全部小写,因为它在DNS中使用。

对于某些参数的区分大小写,Azure API非常挑剔,如果您弄错了,您将收到错误请求响应而没有进一步的信息。

如果问题出在订阅ID或证书上,您将收到未经授权的回复。我认为你已经获得了授权并且失败了,因为请求中的某些内容无效。

答案 1 :(得分:0)

存储帐户必须小写。我不确定这是你的问题(可能是cmdlet自动小写它),但这是尝试的东西。