Search code examples
azure-spring-boot

No Deployments Created when Creating a Spring Boot App


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?


Solution

  • 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