Skip to content

This is a Tomcat CRUD sample application for Azure App Service and the Azure Database for MySQL flexible server.

License

Notifications You must be signed in to change notification settings

myschkyna/msdocs-tomcat-mysql-sample-app

 
 

Repository files navigation

page_type languages products urlFragment name description
sample
azdeveloper
java
bicep
azure
azure-app-service
azure-database-mysql
azure-virtual-network
msdocs-tomcat-mysql-sample-app
Deploy a Tomcat web app with MySQL in Azure
This is a Tomcat 10.1 web app using Servlet 6.0 and the Azure Database for MySQL flexible server.

Deploy a Tomcat web app with MySQL in Azure

This is a Tomcat 10.1 web app using Servlet 6.0 and the Azure Database for MySQL flexible server. The Tomcat app is hosted in a fully managed Azure App Service. This app is designed to be be run locally with a Jetty plugin and then deployed to a Tomcat container in Azure App Service. You can either deploy this project by following the tutorial Deploy a Tomcat web app with MySQL in Azure or by using the Azure Developer CLI (azd) according to the instructions below.

Run the sample

This project has a dev container configuration, which makes it easier to develop apps locally, deploy them to Azure, and monitor them. The easiest way to run this sample application is inside a GitHub codespace. Follow these steps:

  1. Fork this repository to your account. For instructions, see Fork a repo.

  2. From the repository root of your fork, select Code > Codespaces > +.

  3. In the codespace terminal, run the following command:

    mvn jetty:run
  4. When you see the message Your application running on port 80 is available., click Open in Browser.

Quick deploy

This project is designed to work well with the Azure Developer CLI, which makes it easier to develop apps locally, deploy them to Azure, and monitor them.

🎥 Watch a deployment of the code in this screencast.

Steps for deployment:

  1. Sign up for a free Azure account

  2. Install the Azure Dev CLI. (If you opened this repository in a Dev Container, it's already installed for you.)

  3. Log in to Azure.

    azd auth login
  4. Provision and deploy all the resources:

    azd up

    It will prompt you to create a deployment environment name, pick a subscription, and provide a location (like westeurope). Then it will provision the resources in your account and deploy the latest code. If you get an error with deployment, changing the location (like to "centralus") can help, as there may be availability constraints for some of the resources.

  5. When azd has finished deploying, you'll see an endpoint URI in the command output. Visit that URI, and you should see the CRUD app! 🎉 If you see an error, open the Azure Portal from the URL in the command output, navigate to the App Service, select Logstream, and check the logs for any errors.

  6. When you've made any changes to the app code, you can just run:

    azd deploy

Getting help

If you're working with this project and running into issues, please post in Issues.

About

This is a Tomcat CRUD sample application for Azure App Service and the Azure Database for MySQL flexible server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Bicep 55.6%
  • Java 42.7%
  • Dockerfile 1.7%