简体   繁体   中英

Azure Pipelines Agent artifact failed to apply

I am trying to apply Azure Pipeline Agent artifact while creating an Azure VM from the pipeline using Azure Dev Test Lab Create VM Task. I have provided all the valid values in the ARM Template(organization, pat, agent name, etc) but the specified artifact is failed to apply. here is the exception info Validating parameters Preparing agent installation location Checking for previously configured agent Downloading agent package Extracting agent package contents Getting agent installer path Installing agent

ERROR: Connecting to remote server localhost failed with the following error message : The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". For more information, see the about_Remote_Troubleshooting Help topic.

The artifact failed to apply.

Anyone has any idea on why I am getting this exception? please help me if you have any information

(401) Unauthorized

This means that your token is not be get and used correctly. Just for test purpose, you can create a PAT with Full access scope to see if this works.

在此处输入图片说明

You need to check whether your token is correctly converted to Base64String in the script.

$token = "{PAT}"
$token = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($token)"))

In addition, if you tried the above two points and the problem still exists, you can share your script sample in the question for further investigation.

在安装工件之前配置 WinRM 后,问题已解决。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM