Java Project not running on Azure

Deune Nel 0 Reputation points
2024-11-19T12:20:42.5066667+00:00

Good Day, Basically the issues is that i have deployed my Java Springboot project to azure and i am trying to test and run my api's i use this link provided by azure. however it is not working it keeps saying that "You do not have permission to view this directory or page". I am using postman to test and see if it works but it doesnt. i did a test to see if the connection string was the issue so i run the project locally and connected to the database hosted in azure and it works perfectly no issues. What am i doing wrong?

What i have dont so far is

  1. Check Connection Strings
  2. Check the network settings - all looks fine
  3. tried the link with port 80 and 8080 not working.
  4. Redeployed the java project and it is still not working

Kind Regards

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

1 answer

Sort by: Most helpful
  1. Vinodh247 24,091 Reputation points MVP
    2024-11-23T08:28:30.73+00:00

    "You do not have permission to view this directory or page" typically indicates a configuration issue with the deployed application or the Azure App Service itself.

    1. Verify Deployment Logs: Check the deployment logs in the Azure Portal to ensure that your Java Spring Boot project was deployed successfully without errors.
    2. Ensure the WAR/JAR File is Executed: If you deployed a JAR/WAR file, ensure it is being executed correctly on the App Service.
    3. Ensure that your application is bound to the correct port. Azure App Service uses port 80 for HTTP traffic. Spring Boot must be configured to bind to 0.0.0.0 on port 80
    4. Ensure that the endpoint URL is correct (e.g., https://<app-name>.azurewebsites.net/api/resource). If authentication is required, add appropriate headers or tokens in Postman.
    5. Double-check that the App Service can access the database
    6. Clean the build (mvn clean package) and redeploy. Test with curl or a browser directly to the URL (e.g., https://<app-name>.azurewebsites.net/api/resource).
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.