powershell - 使用 Powershell 2 部署 Azure 项目时出现问题

标签 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

最佳答案

您是否有正在运行的本地代理(例如 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/

相关文章:

azure - kubectl : net/http: TLS handshake timeout

python - 从按日期/名称分组的单独目录中的 JPEG 生成 PDF

powershell - ffmpeg在编码时保持完整标题

powershell - Powershell:通过字符串数组过滤文件的内容

windows - 从 Get-WinEvent 获取用户名

azure - 通过 powershell 的虚拟网络对等互连错误

azure - 使用 shell 脚本列出 Azure 文件存储中 10 天前的文件

azure - Azure 中托管的 ASP .net Core 缺少洞察数据

powershell - 如何动态替换字符串的最后一部分?

javascript - Azure 函数服务总线输出消息属性