page_type | languages | products | urlFragment | name | description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sample |
|
|
java-on-aca-quarkus |
Java Quarkus Apps on Azure Container Apps |
Build and deploy Java Quarkus applications on Azure Container Apps using the Azure Developer CLI (azd) |
The project consists of a few microservices that are deployed to Azure Container Apps using the Azure Developer CLI (azd):
- city-service: A Quarkus application that provides a list of cities. It's backed by Azure Database for PostgreSQL Flexible Server, instrumented with OpenTelemetry, and built into Quarkus native image.
- weather-service: A Quarkus application that provides weather information for a given city. It's backed by Azure Database for MySQL Flexible Server, instrumented with OpenTelemetry, and built into Quarkus native image.
- gateway: A Nginx reverse proxy. It routes requests from the frontend to the appropriate service introduced above, and also instrumented with OpenTelemetry.
- weather-app: A Vue.js frontend that connects to the gateway and displays the weather information for cities.
With Azure Developer CLI (azd), you’re just a few commands away from having this fully functional sample application up and running in Azure. Let's get started!
Refer to the App Templates repository Readme for more samples that are compatible with
azd
.
If you want to run the template locally, you need to satisfy the following requirements:
- Bash for Unix-like systems or PowerShell 7 for Windows
- Azure Developer CLI
- OpenJDK 17
- Node.js with npm (20.18.0+)
- Docker
- Make sure Docker is targeting the Linux containers if you are using Docker Desktop for Windows. See Run Your First Linux Container for more information.
- An Azure account with an active subscription. Create one for free if you don't have an account.
To learn how to get started with any template, follow this quickstart. For this template Azure-Samples/java-on-aca-quarkus
, you need to execute a few additional steps as described below.
This quickstart will show you how to authenticate on Azure, initialize using a template, provision the infrastructure, and deploy the code to Azure:
# Log in to azd if you haven't already
azd auth login
# First-time project setup. Initialize a project in the current directory using this template
azd init --template Azure-Samples/java-on-aca-quarkus
# Provision and deploy to Azure
azd up
At the end of the deployment, you should see 4 services deployed, including city-service, gateway, weather-app, and weather-service. Open the Endpoint of the service weather-app, select Go button, and you should see the weather application which looks like the screenshot above.
This sample application uses the following Azure resources:
- Azure Container Apps (Environment) to host 4 microservices as Container Apps
- Azure Container Registry to host Docker images for 4 microservices
- Azure Database for PostgreSQL Flexible Server to store the data for the city-service
- Azure Database for MySQL Flexible Server to store the data for the weather-service
- Azure Monitor for monitoring and logging
This template provisions resources to an Azure subscription that you will select upon provisioning them. Refer to the Pricing calculator for Microsoft Azure to estimate the cost you might incur when this template is running on Azure and, if needed, update the included Azure resource definitions found in
infra/main.bicep
to suit your needs.
This template is structured to follow the Azure Developer CLI template creation concepts. You can learn more about azd
architecture in the official documentation.
At this point, you have a complete application deployed on Azure.
You have deployed the sample application using Azure Developer CLI, however there is much more that the Azure Developer CLI can do. These next steps will introduce you to additional commands that will make creating applications on Azure much easier. Using the Azure Developer CLI, you can setup your pipelines, monitor your application, test and debug locally.
-
azd down
- to delete all the Azure resources created with this template -
azd pipeline config
- to configure a CI/CD pipeline (using GitHub Actions or Azure DevOps) to deploy your application whenever code is pushed to the main branch. -
azd monitor
- to monitor the application and quickly navigate to the various Application Insights dashboards (e.g. overview, live metrics, logs) -
Run and Debug Locally - using Visual Studio Code and the Azure Developer CLI extension
The Azure Developer CLI includes many other commands to help with your Azure development experience. You can view these commands at the terminal by running azd help
. You can also view the full list of commands on our Azure Developer CLI command page.
If you have any feature requests, issues, or areas for improvement, please file an issue. To keep up-to-date, ask questions, or share suggestions, join our GitHub Discussions. You may also contact us via AzDevTeam@microsoft.com.