1
votes

In DevOps I have a Release pipeline with 3 stages (Init Environment, Test and Clean). In the first stage I use a simple PowerShell Task which starts an application on the same device where my local agent is running. This application has to run until the pipeline finishes, because I need to access it from the other stages too. But it automatically closes when the first stage finishes. I can't prevent it from closing and I don't understand why it closes. When I call this command on a local PowerShell the started application keeps running, even if I close the PowerShell window?!

Here is my task:

The sleep command is just to be sure that the application really starts. Without sleep it is too fast and you don't see the application startup.

PowerShell Task to start application

So my question is: How can I keep the application running until the pipeline is done? Or how can I prevent it from closing automatically, after the first stage finished? Do I miss a pipeline setting or perhaps a setting in the agent?

1

1 Answers

1
votes

No, you can't do that. There's a very simple reason why:

There is no guarantee that the same agent is used between jobs. Agents can run in parallel and across many different machines at once. Even if you could do what you're asking, what you'd be doing is designing a process that is unable to be scaled out or parallelized.