Azure Container Instance doesn't forward requests to container

Frederic Desgreniers 6 Reputation points
2022-02-19T12:18:13.523+00:00

I'm trying to deploy a spring boot project to azure using docker containers.

If I do az container logs --name ... --resource-group ... I see

Tomcat started on port(s): 80 (http) with context path ''

az container show --name ... --resource-group ...

"ipAddress": {
    "dnsNameLabel": "X",
    "dnsNameLabelReusePolicy": "Unsecure",
    "fqdn": "X.centralus.azurecontainer.io",
    "ip": "Y",
    "ports": [
      {
        "port": 80,
        "protocol": "TCP"
      }
    ],
    "type": "Public"
  },

Now if I go to X.centralus.azurecontainer.io I only see 404 page not found and don't see any request being made in the logs for the spring container (have logs set to debug to see if it serves anything)

On the azure portal it also confirms that my container is in state "Running"

For what reasons does "page not found" show instead of just forwarding to the container on the same port? Anyone know what could be wrong here?

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
691 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. srbhatta-MSFT 8,551 Reputation points Microsoft Employee
    2022-02-21T13:11:30.073+00:00

    Hello @Frederic Desgreniers ,
    Thanks for reaching out to Microsoft QnA.
    I understand you are getting a 404 page not found error when you are trying to access the application via fqdn.
    Here are a couple of things you may want to check.
    Firstly, please check the application, whether the appropriate file which consists the landing page (for eg index.html) for your application is present.
    Secondly, could you check the Dockerfile and confirm if port 80 has been correctly EXPOSE(d).

    Did you try to run the same on local docker installation? Did it work there? If it does not work locally, then I am guessing it must be some misconfiguration on the application front. Please feel free to reach back by tagging me.

    -----------------------

    Please don't forget to "Accept as Answer" and "Upvote" and if you think my response was helpful, so that it can help others in the community looking for help on similar issues.


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.