This example shows how you can deploy a Spring Boot app to an Azure App Service instance using Pulumi in a Jenkins Pipeline. The Spring Boot app is packaged into a container image that is automatically (and conveniently!) built as part of the Pulumi app. The container image is pushed up to a private Azure Container Registry and then used as the source for an App Service instance.
-
Create a new stack:
$ pulumi stack init dev
-
Login to Azure CLI (you will be prompted to do this during deployment if you forget this step):
$ az login
-
Restore NPM dependencies:
$ cd infrastructure $ npm install
-
Run
pulumi up
to preview and deploy changes:$ pulumi up Previewing changes: + pulumi:pulumi:Stack jenkins-tutorial-dev create + docker:image:Image spring-boot-greeting-app create + azure:core:ResourceGroup jenkins-tutorial-group create + azure:containerservice:Registry myacr create + azure:appservice:Plan appservice-plan create + azure:appservice:AppService spring-boot-greeting-app create + pulumi:pulumi:Stack jenkins-tutorial-dev create ...
-
Check the deployed website endpoint:
$ pulumi stack output appServiceEndpoint https://azpulumi-as0ef47193.azurewebsites.net $ curl "$(pulumi stack output appServiceEndpoint)/greeting" {"id":1, "content": "Hello, World"}