简体   繁体   中英

Azure GIT continous deployment for default Java WebApp (using default Tomcat)

Currently, when you deploy a Java WebApp using the default Tomcat, the default Tomcat will listen for WAR archives on D:\\home\\site\\wwwroot\\webapps (See https://azure.microsoft.com/en-us/documentation/articles/web-sites-java-add-app/ ).

The problem is that if you plan to use continuous deployment through GIT, the new fetched archives will be copied under wwwroot folder, not under wwwroot/webapps, so the default Tomcat can listen on them.

Is there any way in which I can tell the default Tomcat to listen for War archives on a specific folder (eg wwwroot instead) ? Are there settings that I can play with?

Having a custom Tomcat (second solution of http://blogs.msdn.com/b/azureossds/archive/2015/12/11/use-custom-context-for-azure-tomcat-application.aspx ) is not the most optimal solution, since we will have to copy the Tomcat to all deployment slots that we configure (that's error prone). Deployment slots should be as similar as possible.

At the same time, some of the settings from ApplicationSettings won't be applied anymore, since they apply only on the default Tomcat.

There is my answer for the other thread that the needs was similar with yours. I think it can help you, please refer to the thread Azure Tomcat Eclipse Deployment .

Based on my understanding, you want to deploy the war file into Azure WebApps thru Azure Git continuous deployment. So you can follow the steps modified from the answered thread above, see below.

  1. Open the git bash cmd and make a new directory webapps for war files.
  2. Copy or export the war file into the directory webapps .
  3. git init
  4. git add webapps
  5. git commit -m "Something Commit"
  6. git remote add <app-name> <git-clone-url>
  7. git push <app-name> master

Note: For the variables <app-name> and <git-clone-url> , you can find them on Azure new portal.

Now, you can browse https://<app-name>.azurewebsites.net/<war-file-name> to see it after tomcat unzip the war file to the same name folder automatically.

For continous deployment, you just need to repeat the step 2, 4 and 6.

Any concern, please feel free to let me know.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM