0
votes

After a deployment in linux server from azure devops, I am want to copy a log file from linux server and display in azure devops.In ssh task i tried the following command echo ##vso[task.uploadfile]/xxx/xxxxxx/xxxxx/log/xxxxxx/console-20200625.log the task is successful but can't find the log file.

1
Do you use the self-hosted agent installed on the linux server to run the pipeline?Hugh Lin
The agent used is a self hosted windows agent. I run via SSH task from azure devops to communicate to linux server for executing a script for deployment.Sar
is it possible to copy a file from linux server to azure devops windows agent.??scp /xxx/xxxxxx/xxxxx/log/xxxxxx/console-20200625.log [email protected]:/C:/Users/xxxx. i tried SCP as well but got connection refused errorSar
You can use Remote Copy task to copy the file from linux server to your self-hosted agent.Hugh Lin
Not get your latest information, is the workaround helpful for you? If it is helpful, please mark it as answer, just click the option like this. Or if you have any concern, feel free to share it here.Hugh Lin

1 Answers

0
votes

UploadFile: Upload a file that can be downloaded with task logs: ##vso[task.uploadfile]local file path

task.uploadfile is to upload a local file to the pipeline. Since you are using a self-hosted windows agent,so the file on the linux server is not uploaded.

As workaround , you can try to use Remote Copy task to copy the file from linux server to your self-hosted agent. Then upload this file from the local agent.

In Remote Copy task, you can specify the remote machine IP address in the Remote Machine field and the destination path for copy in the Destination field. It can be on local machine or on remote machine.