I use Visual Studio Online build tools to deploy web applications from a single solution. I sometimes ran into file locking issues.
Error: Web deployment cannot modify the file "Microsoft.CodeAnalysis.CSharp.dll" in the destination because it is blocked by an external process.
After some Googling, I think the “fix” is to stop the web applications before deploying to Azure and start backing it up afterwards. Sounds legal.
However, there seems to be no direct way to do this directly in VSO definitions. I created an Azure Powershell build task, but it wants to get the PS1 file from the repository. This does not seem to allow me to run Azure Powershell commands (e.g. Stop-AzureWebsite). My team created a working environment where we have "run.ps1", which simply executes the command that you pass as a parameter, but none of us are satisfied with this.
What are we missing? There should be an easier way to do this without checking the PS1 script in the source control.
powershell azure vsts
agartee
source share