Honghai Mei
Honghai Mei

Reputation: 81

Question on Spring Boot + Azure Listening Port

I am a spring boot starter and a cloud starter, and I deploy my spring boot project (Rest API) in Azure via App Service (Using Intellij Plugin Azure ToolKit).

When I get my deploy url which is like https://DOMAIN.azurewebsites.net, I am curious why I can fetch my data without typing :8080 PORT. I don't add the server.port=8080 in my application.properties.

Usually, if you are deploying your spring boot project in a Linux instance (Both AWS EC2 and Azure VM), and you can get your data by typing: http://<YOUR_LINUX_PUBLIC_IP>:8000

I try to get my data by both https://DOMAIN.azurewebsites.net and http://.azurewebsites.net, and they all work.

However, if I try: https://****.azurewebsites.net:8000, it shows I can not access this URL. Is Azure applying my Spring Boot Service to both HTTPS and HTTP port by default?

Upvotes: 1

Views: 526

Answers (1)

Joseph  Xu
Joseph Xu

Reputation: 6043

Web Apps don't have a port-mapping feature. The only ports open for Web Apps are 80 and 443.
https://DOMAIN.azurewebsites.net:443
http://DOMAIN.azurewebsites.net:80
Traffic Manager does not provide port-mapping. You'd need to run your own proxy for handling this.
enter image description here

So we can't specify 8080 port in Web Apps. If you need that control, you can use Cloud Services or Virtual Machines.
Refer to this answer.

Upvotes: 2

Related Questions