Мы установили установку Winrm в качестве предварительных условий в конвейере, как показано ниже
Ошибка, которую мы получаем в необработанном журнале задачи:
Failed to add the extension to the vm: '<VM name>'. 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 "
##[debug]Validating the winrm configuration custom script extension status on vm: <VM name>
У виртуальной машины был частный ip, поэтому мы предположили, что виртуальная машина не может подключиться к inte rnet, но мы могли запустить ее с виртуальной машины вручную, как указано ниже!
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/maste
r/201-vm-winrm-windows/ConfigureWinRM.ps1" -Outfile "c:\temp\ConfigureWinRM.ps1"
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-vm-winrm-windows/makecert.exe" -Outfile "c:\temp\makecert.exe"
./C:\temp\ConfigureWinRM.ps1 -HostName 10.10.10.10 <IP edited>
Почему WinRM агент провалился? Как мы можем отладить такие проблемы? К сведению: мы решили эту проблему, удалив необходимое условие из конвейера и вместо этого использовав «расширение собственного скрипта» и загрузив PowerShell из учетной записи хранения.