使用Powershell 2部署Azure项目的问题

时间:2011-12-27 07:33:37

标签: powershell azure

我使用了Azure培训套件命令

New-Deployment 
    -serviceName <YOUR_SERVICE_NAME_LOWER_CASE> 
    -subscriptionId <YOUR_SUBSCRIPTION_ID> 
    -certificate (get-item cert:\CurrentUser\MY\<YOUR_CERTIFICATE_THUMBPRINT>) 
    -slot staging 
    –package <PACKAGE_LOCATION> 
    -configuration <CONFIGURATION_LOCATION>  
    -label "v2.0" 
    –storageServiceName <YOUR_STORAGE_SERVICE_NAME_LOWER_CASE>

部署我的Azure应用。它能够将包上传到blob,但是当创建新部署时,它将错误显示为:

New-Deployment : Cannot access a closed Stream.
At line:1 char:15
+ New-Deployment <<<<  -serviceName mytodo -subscriptionId xxxxxxxxx
8ad-360cdbdc361f -certificate (get-item cert:\CurrentUser\MY\xxxxxxxx
6DD27E3DFF5F7FE24A3FBF) -slot staging -package MyTodo.cspkg -configuration Serv
iceConfiguration.cscfg -label "v1.0" -storageServiceName xxxxx
    + CategoryInfo          : CloseError: (:) [New-Deployment], ObjectDisposed
   Exception
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Samples.ManagementTools.P
   owerShell.Services.HostedServices.NewDeploymentCommand

1 个答案:

答案 0 :(得分:0)

您是否有本地代理(例如Fiddler)正在运行?如果是这样,您需要将其禁用。

另外,检查证书是否安装正确且位置正确:按照信中的说明进行操作:

http://msdn.microsoft.com/en-us/gg271300

特别注意(get-Item cert:\CurrentUser\MY\XXXXX)的路径中没有换行符或空格。