Azure DevOps pipeline: remote powershell task seems never finish

%3CLINGO-SUB%20id%3D%22lingo-sub-3298586%22%20slang%3D%22en-US%22%3EAzure%20DevOps%20pipeline%3A%20remote%20powershell%20task%20seems%20never%20finish%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3298586%22%20slang%3D%22en-US%22%3E%3CP%3EI%20try%20the%20%22run%20powershell%20on%20remote%20machines%22%20task%20to%20restart%20my%20Tomcat%20(java)%20service%20on%20the%20Windows%20server.%3CBR%20%2F%3EIt%20just%20keep%20printing%20useless%20info%20in%20the%20console%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Han_Shih_0-1651225091549.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F367946i135E7B0FC3EB0CD4%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Han_Shih_0-1651225091549.png%22%20alt%3D%22Han_Shih_0-1651225091549.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20the%20detail%20about%20the%20powershell%20script%3A%3CBR%20%2F%3E1.%20stop%20Tomcat%20service%20(call%20a%20.bat%20file)%3CBR%20%2F%3E2.%20move%20.jar%20files%20to%20right%20location%20%26amp%3B%20replace%20old%20files%3CBR%20%2F%3E3.%20start%20Tomcat%20service%20(call%20a%20.bat%20file)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%26amp%3B%20D%3A%5CMY%5CPATH%5Cstop.bat%3B%0A%0A......%0ACopy-Item%20-Path%20%22D%3A%2Fs-1.0.jar%22%20-Destination%20%24sqs_path%20-Force%3B%0A......%0A%0A%26amp%3B%20D%3A%5CMY%5CPATH%5Cstart.bat%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EWhen%20I%20run%20the%20same%20command%20directly%20in%20that%20windows%20server%2C%20the%20%22powershell%20part%22%20trigger%20.bat%20script%20job%2C%20then%20get%20back%20to%20powershell%20console%20successfully%20.%3CBR%20%2F%3ELater%2C%20a%20new%20window%20pops%20out.%20The%20new%20window%20is%20Tomcat%20server%20that%20shows%20logs%20of%20my%20service.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20when%20I%20do%20the%20same%20job%20with%20Azure%20release%20pipeline%2C%20the%20Tomcat%20window%20did%20not%20show%20up.%3CBR%20%2F%3EAnd%20release%20job%20console%20keep%20hanging.%3CBR%20%2F%3EI%20think%20somewhat%20the%20output%20of%20popout%20window%20has%20be%20redirected%20to%20the%20console%20in%20release%20pipeline.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20addition%2C%20if%20I%20cancel%20the%20release%20job.%20my%20Tomcat%20service%20still%20working.%20(just%20without%20console%20to%20debug)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOr%2C%20another%20thought%2C%20can%20I%20achieve%20my%20goal%20with%20other%20task%3F%20(powershell%20is%20not%20a%20%22must%22)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EAny%20suggestion%20would%20be%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I try the "run powershell on remote machines" task to restart my Tomcat (java) service on the Windows server.
It just keep printing useless info in the console

Han_Shih_0-1651225091549.png

 

 

Here is the detail about the powershell script:
1. stop Tomcat service (call a .bat file)
2. move .jar files to right location & replace old files
3. start Tomcat service (call a .bat file)

 

& D:\MY\PATH\stop.bat;

......
Copy-Item -Path "D:/s-1.0.jar" -Destination $sqs_path -Force;
......

& D:\MY\PATH\start.bat;

 


When I run the same command directly in that windows server, the "powershell part" trigger .bat script job, then get back to powershell console successfully .
Later, a new window pops out. The new window is Tomcat server that shows logs of my service.

 

However, when I do the same job with Azure release pipeline, the Tomcat window did not show up.
And release job console keep hanging.
I think somewhat the output of popout window has be redirected to the console in release pipeline.

 

In addition, if I cancel the release job. my Tomcat service still working. (just without console to debug)

 

Or, another thought, can I achieve my goal with other task? (powershell is not a "must")

 


Any suggestion would be appreciated.

 

 

0 Replies