I have deployed node.js(express) web application using azure pipelines. The application listens on port specified by
server.listen(process.env.PORT ||3000);
When logging process.env.PORT using a route, it displays 8080 but the app is running on port 443. How does this happen? The application is not accessible on port 8080.
Asked
Active
Viewed 174 times
0
Nevus
- 1,145
- 1
- 6
- 18
-
How you are accessing the url ? access your site with the url https://myapp.azurewebsites.net. – HarshithaVeeramalla-MT Jan 05 '22 at 04:44
-
I do use the url. My problem being I don't understand what's happening. Server should by listening either on port 8080 or port 3000. It seems to somehow run on port 443 and port 80. – Nevus Jan 05 '22 at 11:04
1 Answers
0
- Azure app services only supports ports
80and443. So check if only one port is enabled in the program. Such as configuringport: process.env.PORT || 3000. - It is recommended to use git for continuous deployment to test whether your webapp project can run normally in azure app services
If continuous deployment using Git is successful:
If git continuous deployment can replace your deployment method requirements, and the project can start normally, then your problem will be solved.
But if you must want deploy apps by using devops, there may be errors when configuring release.
Please refer Migration checklist when moving to Azure App Service ,SO thread and this for more details.
HarshithaVeeramalla-MT
- 3,013
- 2
- 2
- 9
-
I created a route that responds with `res.json({ envPort: process.env.PORT || 'unknown' });` When accessing the route, the result is `"envPort":"8080"`. Am I missing something? – Nevus Jan 11 '22 at 02:16
-