0

I have deployed a spring app called shape-shop-app :

enter image description here

It says the application failed to start and I should check the logs.

This is what it looks like in Azure :

enter image description here

This is where I am confused.

Where are the logs?

If I go to the console for shape-shop-app then it is empty.

enter image description here

If I go to the "Azure Spring Apps" Logs tab then I am bombarded with thousands of queries I can choose from. I really just want to find out what error caused my spring app to go down but I am lost among all these specific log queries. The most generic queries yield no results.

How can I diagnose why my spring app failed to start in azure?

Oliver Watkins
  • 12,575
  • 33
  • 119
  • 225

1 Answers1

2

Application failed to start.

Generally, this error occurs when the application is not deployed properly (or) If any file/configuration is missing. Re-deploy your application to fix the issue.

If I go to the console for shape-shop-app then it is empty.

Select your App instance from the drop down in the Console and click on Connect.

enter image description here

To check the logs use the query:

az spring app logs --resource-group <Resource_group_name> --service <Service_instance_name> --name <App_name> --follow

enter image description here

Refer MSDOC for Monitoring Azure Spring Apps with logs, metrics, and tracing.

  • You can also enable Remote debugging. This helps to attach a debugger to the application and figure out the issue.

enter image description here


Try to deploy your application as shown below:

Go to the root folder of your spring-boot application and run the below commands:

mvn com.microsoft.azure:azure-spring-apps-maven-plugin:1.17.0:config

enter image description here enter image description here

  • mvn clean install

enter image description here

Deploy:

  • mvn azure-spring-apps:deploy

enter image description here enter image description here

Portal: enter image description here

Assign Endpoint:

enter image description here

It generates the URL as shown below:

enter image description here

Response:

enter image description here

Pravallika KV
  • 2,415
  • 2
  • 2
  • 7
  • thankyou kindly for your answer. I tried to look at the logs but it comes back as NOT FOUND : C:\dev\petsitter-backend>az spring app logs --resource-group shapeShopResourceGroup --service shapeshop2 --name petsitter-backend-app --follow Operation returned an invalid status 'Not Found' – Oliver Watkins Jul 05 '23 at 16:07
  • @OliverWatkins, Check if Service Instance name `service shapeshop2` and application name `--name petsitter-backend-app` is valid and available. – Pravallika KV Jul 07 '23 at 13:09
  • 1
    having no luck with the az console. It is really terrible. I am going to try your suggestion with debugging from IntelliJ :) – Oliver Watkins Jul 11 '23 at 15:34
  • No luck with remote debugging either. I have opened a seperate ticket: https://stackoverflow.com/questions/76663790/cannot-find-remote-debug-setting-for-a-spring-boot-app-in-azure – Oliver Watkins Jul 11 '23 at 16:24
  • Can you try to deploy your application with the steps I gave in the answer? – Pravallika KV Jul 11 '23 at 16:39
  • 1
    sorry...............done – Oliver Watkins Jul 20 '23 at 09:28