microsoft / azure-pipelines-extensions

Collection of all RM and deployment extensions
http://www.visualstudio.com/explore/release-management-vs
MIT License
275 stars 425 forks source link

Forced verbose logging causes increased runtime #1117

Open bjowes opened 1 year ago

bjowes commented 1 year ago

We are using the task IISWebAppMgmt@3 to deploy our web apps to IIS. The runtime of this task is rather long (about 40 seconds, occasionally much longer) given the actions it actually performs.

When investigating runtime for our other tasks I found that the amount of logging from Remote PowerShell execution has a significant impact on runtime. We had one task where the runtime was reduced from 40 seconds to 9 seconds simply by disabling verbose logging. After this find I looked into if I could somehow disable verbose logging for the IISWebAppMgmt@3 task. However, it seems that verbose logging is hard coded into a utility method used by the task, from this specific line: https://github.com/microsoft/azure-pipelines-extensions/blob/abe243f4b9743108c1f3a42e75dcc2515f064dbd/TaskModules/powershell/RemoteDeployer/RunPowerShellScriptJob.ps1#L102

Given how it is coded, I don't think it is possible to disable the verbose logging. Please add this possibility! In my view a better default would be to not output verbose logging, but instead provide a possibility to enable it. Verbose logging could for instance be controlled by:

I have not investigated how many tasks are affected by this, but I assume that IISWebAppMgmt@3 is just one of many that use the relevant script for remote PowerShell execution. Hence, fixing this has a great potential in improving deployment runtime for a huge amount of Azure DevOps users.

If the above makes sense, I would be happy to provide a PR to implement it.