我使用了 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
最佳答案
您是否有正在运行的本地代理(例如 Fiddler)?如果是这样,您需要禁用它。
此外,请检查证书是否正确安装并安装在正确的位置:严格按照此处的说明进行操作:
http://msdn.microsoft.com/en-us/gg271300
特别注意 (get-Item cert:\CurrentUser\MY\XXXXX)
的路径中没有换行符或空格。
关于powershell - 使用 Powershell 2 部署 Azure 项目时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8642175/