0

A sprint boot rest api is deployed as the web app via fire up a docker image in Azure. After that I need to make a POST request to test the API. Here comes the issues. I seems can't access the API. It is not the issue of the code itself since I can get the result if I deployed the code locally,

Here are some of my key steps

  1. I add the following user command when fire up the application from the docker image (docker image is saved in the azure container registry)

    docker run -d -p 8177:8177 my-api-image:latest

  2. login to azure from azure-cli

    az login

  3. I query the post method in the terminal

    curl -X POST -'from=161&to=169&limit=100' https://<my-app-name>.azurewebsites.net:8177/readRecords

But I am keep getting the Connection time out error

Failed to connect to <my-app-name>.azurewebsites.net port 8177: Connection timed out

I also try to run the curl method from the shell from the Azure Portal in the browser, it also told me the time out error Anyone know the reason of this? and how can I solve it so that I can send a post request.

SLN
  • 4,772
  • 2
  • 38
  • 79
  • 1
    Azure web app only support 80&443 port. – Jason Pan Apr 15 '21 at 01:45
  • 1
    If my reply is helpful, please accept it as answer(click on the mark option beside the reply to toggle it from greyed out to fill in.), see https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – Jason Pan Apr 15 '21 at 01:50

1 Answers1

1

Azure web app only support http 80 and https 443 port.

So your port 8177 doesn't work. For more details, please read my answers in below posts.

Related posts:

1. Strapi on Azure does not run

2. Django channels and azure

Jason Pan
  • 15,263
  • 1
  • 14
  • 29