0

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?

  • 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 Jul 18 '18 at 01:59

1 Answers1

0

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)

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53
  • >BTW, by default, the war file should be in site\wwwroot\webapps.< I would like that since that's where the Azure Release process drops it. If it behaved that way I would not need to post here. Dropping the war in /site/wwwroot/webapps does nothing. The only way the war is exploded is by me manually dropping it into /site/wwwroot/bin/apache-tomcat-8.5.24/webapps. – Orlando Colamatteo Jul 19 '18 at 04:32
  • oddly enough, when deploying to a Deployment Slot it works fine! Azure deploys the war to /site/wwwroot/webapps in my "test" Deployment Slot and the war is exploded. I am stumped as to why when deploying to the default "production" Deployment Slot the same way the war is not exploded and I have to move it to /site/wwwroot/bin/apache-tomcat-8.5.24/webapps to get things working. – Orlando Colamatteo Jul 19 '18 at 04:50
  • Do you mean the war files have been deployed to /site/wwwroot/bin/apache-tomcat-8.5.24/webapps for Deployment slot? Can you share these release logs? – starian chen-MSFT Jul 21 '18 at 07:31
  • In the Deployment Slot, if you go in through FTP the path /site/wwwroot/bin/apache-tomcat-8.5.24/webapps *is not* accessible. In the Deployment Slot I drop the war in /site/wwwroot/webapps and it works. In the Production Slot, if you go in through FTP the path /site/wwwroot/bin/apache-tomcat-8.5.24/webapps *is* accessible and that is the only way to deploy the app, i.e. dropping it in /site/wwwroot/webapps does not seem to work. – Orlando Colamatteo Nov 08 '18 at 06:51