Unable to Deploy Spring Boot App in Azure

322 Views Asked by At

I am learning how to deploy my Spring Boot app on Azure. I got through some tutorials. I created Azure Spring Apps named "keyvault-demo-app" under a resource. I deployed it. But when I run the the command:

az spring app deploy -s keyvault-demo-app -g XXXX -n keyvault-demo-app --artifact-path <path-to-JAR-file>

I get the error:

App keyvault-demo-app not found

I just wanted to know what is the correct syntax for the command. I copied it from the Azure Portal.

1

There are 1 best solutions below

0
On

I tried to repro this same in my environment by creating a app deployment after provisioning the azure spring app. I got the same error as no app with that name available in the azure spring apps. So before deploying to app we have to create an app in azure spring service. I used below command to create an app.

az spring app create --resource-group rg-group --service azspringappvjy01 --name azspringappvjy01-app01 --cpu 1 --memory 2Gi --min-replicas 2 --max-replicas 2 --assign-endpoint true

output: enter link description here https://i.imgur.com/NFiNSiz.png

Verify the app in azure portal in azure spring service.

enter image description here

Now deploy artifacts to the app created on azure spring service as below.

az spring app deploy --resource-group rg-group --service azspringappvjy01 --name azspringappvjy01-app01 --artifact-path target/spring-boot-complete-0.0.1-SNAPSHOT.jar --env testEnvKey=testEnvValue --runtime-version Java_11 --jvm-options '-Xms1024m -Xmx2048m'

output: enter link description here enter image description here

Reference: Deploy azure spring app | Microsoft