0

How to map a network drive on Azure Pipeline Agent with Windows Server 2019? I'm trying to upload large files from that Azure server to another server.

This command works on my own PC:

NET USE K: https://xxxxx/remote.php/dav/files/xxxxx/ /user:xxxxxx "xxxxxx" 

When I do that on the Azure Pipelines Agent with Windows Server 2019 it says:

system error 67 The network name cannot be found

I need a solution that can be done via the commandline or Powershell, I think. The server has a UI but I can't access that, afaik.

I also tried some NodeJS modules that interface with Next-Cloud via webdav, but those didn't work well with chunked file uploads of ~600 MB.

Edit: I think I need to install: Install-WindowsFeature WebDAV-Redirector. How to do that on an agent? It requires a restart.

Hmm, I geuss I need a selfhosted vm.

Casper
  • 3
  • 3
  • use i. e. ftp, sftp, rsync or similar protocols? all can be used from commandline – djdomi Sep 03 '22 at 04:46
  • Yeah, I had a working solution to upload to & manage files on Next-Cloud via WebDAV, I geuss I can't use it anymore on an Azure Pipeline agent. – Casper Sep 06 '22 at 08:32

1 Answers1

0

It works a bit differently, in a pipeline you can specify where the files are located. https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/download-fileshare-artifacts?view=azure-devops

Edit: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/bash-v3?view=azure-pipelines&viewFallbackFrom=azure-devops

https://docs.nextcloud.com/server/latest/user_manual/en/files/access_webdav.html Use a bash script to connect to nextcloud

Ace
  • 419
  • 6
  • Thanks, but my question is about uploading & sharing builds. I wanted to upload them to Next-Cloud using WebDav, but if I can share them via for instance Teams that would be fine as well. – Casper Sep 08 '22 at 20:59
  • You need to publish an artifcat then. Or run a powershell script from a task – Ace Sep 08 '22 at 21:05
  • Ok, I did the publishartifact task, but do you know how I can get this build to people from our company who don't have access to Azuer DevOps? – Casper Sep 08 '22 at 21:17
  • @Casper download the artificat and upload it somewhere, or give people read access to ado. – Ace Sep 08 '22 at 21:19
  • Yeah I had some trouble with that, webdav not supported / no chunked uploads. I think I can use this: "curl -H "Tranfer-Encoding: chunked" -F file=@fifo https://example.com". Thanks for your help! – Casper Sep 08 '22 at 21:30