none
[Java][Web Apps] Tomcat deployment of SpringBoot WAR RRS feed

  • Question

  • I have 2 issues in testing applications on Azure.

    1) I've created a WAR file for the project and uploaded it to the wwwroot/webapps/ROOT directory (which renamed ROOT to "spring" for my application). I am not sure if I need to do anything else for the application to be run correctly on Tomcat.

    2) Additionally, can you help describe how to deploy a static html/js/css page onto the Azure App Service (Tomcat)? I would like to deploy it to the same server if possible since it is only a single html page.

    Thanks



    Wednesday, May 11, 2016 10:34 AM

Answers

  • Hi,

    Thanks for posting here!

    As I known, the WAR file should be uploaded to the path 'wwwroot/webapps' on Azure, then the tomcat will decompress the war file into a directory with the same name of the WAR. So you just need to create a WAR file with the name "spring" to deploy it into Azure.

    For the second question, there are two ways for deploying a single html page with some javascript & css files.

    1. Directly upload these files for the single html page into the path 'webapps/ROOT'. You can access the page via the url 'http://<webapp-name>.azurewebsites.net/<html-filename>.html'.

    2. You can upload these files for the single page into the path 'webapps/sprint'. You can access the page via the url 'http://<webapp-name>.azurewebsites.net/spring/<html-filename>.html'.

    Best Regards.

    Friday, May 13, 2016 8:16 AM
    Moderator

All replies

  • Hello,

    Thank you for posting here!

    Please check the below answers for your queries.

    1)After creating a WAR file you can place it to wwwroot folder.  Once you've uploaded your WAR file to the webapps folder, the Tomcat application server will detect that you've added it and will automatically load it. Note that if you copy files (other than WAR files) to the ROOT directory, the application server will need to be restarted before those files are used. The autoload functionality for the Tomcat Java web apps running on Azure is based on a new WAR file being added, or new files or directories added to the webapps folder.

    You may want to check the SO thread for detailed steps.

    Also, you may check deployment guidelines for different configurations.

    2) You may check the CDN in Azure App Service for static content.

    Hope this helps,

     

    Regards,

    Ashok

     

     

    If a post answers your question, please click Mark as Answer on that post and Vote as Helpful.

     

    Wednesday, May 11, 2016 7:35 PM
  • Hi,

    Thanks for posting here!

    As I known, the WAR file should be uploaded to the path 'wwwroot/webapps' on Azure, then the tomcat will decompress the war file into a directory with the same name of the WAR. So you just need to create a WAR file with the name "spring" to deploy it into Azure.

    For the second question, there are two ways for deploying a single html page with some javascript & css files.

    1. Directly upload these files for the single html page into the path 'webapps/ROOT'. You can access the page via the url 'http://<webapp-name>.azurewebsites.net/<html-filename>.html'.

    2. You can upload these files for the single page into the path 'webapps/sprint'. You can access the page via the url 'http://<webapp-name>.azurewebsites.net/spring/<html-filename>.html'.

    Best Regards.

    Friday, May 13, 2016 8:16 AM
    Moderator