0
votes

How do you deploy a war file using a VSTS Release to an Azure Web App running Tomcat? I have a CI/CD pipeline working in VSTS setup to build when code is committed, and then Release and push the new war file to Azure when the build completes. Problem is, the war file is deployed to \site\wwwroot\webapps instead of \site\wwwroot\bin\apache-tomcat-8.5.24\webapps where it needs to go to be pulled in as an app into Tomcat.

I have tried setting up a Virtual Application in Azure and referencing that in the Deployment Task however I am not getting the behavior I need. Playing with the Virtual Application options I have been able to affect the name of the delivered war file (not a goal of mine) and the sub-directory where the file is delivered although not the webapps dir under the Tomcat dir. Which options am I missing?

1
You can try to write a script to copy the files to \site\wwwroot\bin\apache-tomcat-8.5.24\webapps and run the script in pipeline.Andy Li-MSFT

1 Answers

0
votes

You can upload/copy files through Kudu API.

Refer to this thread for the details of how to call Kudu API during build/release:

How to access Kudu in Azure using power shell script

BTW, by default, the war file should be in site\wwwroot\webapps. Using Custom Tomcat Configuration in Azure App Services(Windows)