REST API deployed successfully but returns 404

Bruno Valem Aranha 1 Reputation point
2023-01-05T01:05:34.667+00:00

I created an app service and deployed a REST API with the following controller:

@RestController  
@RequestMapping(path="/project")  
public class TestController {  
  
    @GetMapping(path="/test")  
    public String getTest(){  
        return "TEST";  
    }  

The URL is "https://projeto-condominio.azurewebsites.net", so i believe that "{URL}/project/test" should return the String from the method getTest(), but I get HTTP Status 404 everytime.

For reference, i used this video as a guide for my app service: https://www.youtube.com/watch?v=NNjgt_8w9V4

Can anyone help me please?

Thanks!

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,829 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 15,606 Reputation points
    2023-01-05T23:41:54.663+00:00

    Hi @Bruno Valem Aranha ,

    We are sorry to hear you're facing this issue. Thanks for sharing a link to the video you followed. That tutorial is a bit outdated.

    I would also highly recommend following this current Azure tutorial which shows you how to Deploy Spring Boot applications using CLI or using Maven.

    There could be a few reasons why you're getting that error. You can also try the below troubleshooting suggestions:

    • Check to see if the application can run locally with the specified Java runtime version.
    • Test the API using a tool such as Postman to see if you are able to access it and receive a response.
    • Make sure the environment variables have their expected values and the JVM parameters have their expected values.

    Hope that helps. Please let us know if you have further questions

    Thanks,
    Grace


    --If the reply is helpful, please Upvote and Accept as answer--