I have a react application deployed using an Azure virtual machine. To access the app I need to use configured DNS, for example, "http://XYZ.eastasia.cloudapp.azure.com:3000". However, I don't want to include the port num in the URL. How can I port forward in azure so that only by typing 'http://XYZ.eastasia.cloudapp.azure.com' should be enough to access the application?
Asked
Active
Viewed 147 times
1
-
`https://learn.microsoft.com/en-us/azure/dns/tutorial-alias-pip` this should work – Akhil Nayak May 22 '21 at 07:56
-
@AkhilNayak I don't think the solution you pointed will work in this case. It's an alias record, so still we need to include port number in alias address also. – SRIDHARAN May 22 '21 at 09:31
-
Hi Amit, Welcome to SO. few questions for clarification. why is the application running in port 3000 ? Are there any application running in 80 ? If so, have you considered using application gateway ? https://learn.microsoft.com/en-us/azure/application-gateway/rewrite-http-headers-url – SRIDHARAN May 22 '21 at 09:34
-
Why use a virtual machine for this as opposed to a PaaS service like an Azure Web App? – Daniel Mann May 22 '21 at 13:24
-
hi I am a beginner in azure and learning different ways to deploy my application. with vm(Iaas) i ran my application on it and was able to access the application with the use of the public ip provided. React application runs on port 3000 for which i have created an inbound rule as well. As a result i can access my application with ip:3000 or http://XYZ.eastasia.cloudapp.azure.com:3000. However, i want my peers to access my application with only url excluding the port number. – amit chetri May 23 '21 at 05:12
1 Answers
0
If you want to users access your app by URL: http://XYZ.eastasia.cloudapp.azure.com
, you should run your react app on 80
port. Refer to this post to specify a port to run react app.

Stanley Gong
- 11,522
- 1
- 8
- 16