This blog will demonstrate how to provision an app on Azure Spring Apps using Terraform with easy steps.
Terraform is one of the most popular configuration orchestration tools providing a consistent syntax and structure across cloud platforms. It allows safe and convenient design, management, and improvement of infrastructure as code. If you are working in a relatively small team and running DevOps on your own, you can embed Terraform script in your CI/CD pipeline like GitHub Actions to manage everything as code from the provision and config cloud resources to build, test and deploy the app on it. If you are working in an enterprise with a dedicated infrastructure team, you might have that infrastructure team provisioning virtual networks, databases, and compute resources with Terraform, so that the app team can focus on business logic and deploy their code with CI/CD pipeline.
The Spring PetClinic is a popular sample application for tutorials. It was distributed with the Spring Framework until the 2.5 version (2007).
We will use Azure Cloud Shell to walk through the whole steps. If it is your first time using it, you can find more setup info in the official doc.
1. This sample code (name it as petclinic.tf) helps you to setup the necessary configs for petclinic. You may upload this to your git repo and pull it to the azure cloud shell: