Azure管道&x27;WinRMCustomScriptExtension';非公共VM中的基础连接已关闭

Azure管道&x27;WinRMCustomScriptExtension';非公共VM中的基础连接已关闭,azure,powershell,virtual-machine,winrm,Azure,Powershell,Virtual Machine,Winrm,在Azure管道中,当通过部署模板创建VM时,我们可以选择“使用WinRM代理进行配置”,如下所示 这在幕后充当自定义扩展。但是Azure中的内部vnet可能会阻止下载此自定义扩展。这就是我们得到的错误 <datetime> Adding extension 'WinRMCustomScriptExtension' on virtual machine <vmname> <datetime> Failed to add the extension to the

在Azure管道中,当通过部署模板创建VM时,我们可以选择“使用WinRM代理进行配置”,如下所示

这在幕后充当自定义扩展。但是Azure中的内部vnet可能会阻止下载此自定义扩展。这就是我们得到的错误

<datetime> Adding extension 'WinRMCustomScriptExtension' on virtual machine <vmname>
<datetime> Failed to add the extension to the vm: <vmname>. Error: "VM has reported a failure when processing extension 'WinRMCustomScriptExtension'. Error message: \"Failed to download all specified files. Exiting. Error Message: The underlying connection was closed: An unexpected error occurred on a send.\"\r\n\r\nMore information on troubleshooting is available at https://aka.ms/VMExtensionCSEWindowsTroubleshoot "
在虚拟机上添加扩展“WinRMCustomScriptExtension”
未能将扩展添加到vm:。错误:“VM在处理扩展名“WinRMCustomScriptExtension”时报告失败。错误消息:\”未能下载所有指定的文件。退出。错误消息:基础连接已关闭:发送时发生意外错误。\“\r\n\r\n有关疑难解答的详细信息,请访问https://aka.ms/VMExtensionCSEWindowsTroubleshoot "
由于文件无法下载,我想到了两种解决方案:

  • 我如何知道azure正在使用哪些powershell文件来设置winrm
  • 存储文件的位置将是存储帐户(与VM相同的vnet)
  • 可能根本不使用WinRM,而是使用自定义脚本扩展来解决 所有内容(包括存储帐户中的所有文件)。我希望扩展的错误会在发生时停止管道
  • 有没有更好的解决方案?在我看来,azure的设计很糟糕,因为它没有覆盖非公共VM
  • 编辑: 找到了#1)的答案。启用诊断时,这显示在管道的原始日志中

  • 即使你知道-它对你有什么帮助?它无论如何都不能下载它们,而且你也不能告诉它使用本地文件
  • 如果启用服务端点并允许子网与存储帐户通信,则应该可以正常工作
  • 有一种方法可以在创建VM时配置WinRM
  • 您也可以按照自己的意愿使用脚本扩展,但脚本扩展也必须将内容下载到Vm