Search code examples
azureazure-devopsazure-pipelinesazure-pipelines-release-pipelineagent

Deploy console app from Azure Devops (cloud version) to a machine with a Microsoft-provided host agent (Failed to create PSDrive with destination...)


I want to deploy a console application from Azure Devops (cloud version) to a machine (VPN protected) where I installed a Microsoft-provided host agent.

It is working fine for web applications, where I used the release pipeline task 'IIS web app deploy'.

I could deploy my console application using the same task, which I tried with success, but it would look weird, because my IIS would recognize a console app as a web app:

Not the right way to deploy a console app

Although this solution would work, as I could still 'explore the folder' and launch my console application executable, it is not a professional solution.

What I want is to copy the executable to my server's shared folder.

In order to do so I selected the release pipeline task 'Windows Machine File Copy' with the following options:

Windows Machine File Copy Task Options

I must say that I shared the right folder which is accessible to all computers inside my VPN.

Everything looks good to me, but clearly there's a problem as I have the following error:

**> Failed to Create PSDrive with Destination:

'\srvdevrct01\GdmUtilitaires', ErrorMessage: 'The network path was not found'**

What am I missing?


Solution

  • If you have already installed the Azure Pipelines agent to target server, might I suggest creating a deployment group and re-configuring the agent to be part of that?

    https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/copy-files?view=azure-devops&tabs=yaml.

    More information on deployment groups can be found here:

    https://learn.microsoft.com/en-us/azure/devops/pipelines/release/deployment-groups/?view=azure-devops

    In general, if you are running the agent on the target server with sufficent rights, you don't have to rely on WinRM-based tasks, but can run a normal copy task like this: That way you don't have to rely on WinRM-based tasks, but run normal copy like