How to set up NodeJS backend on Azure App Service, server.ts is not reachable

John Siri 0 Reputation points
2025-04-11T23:22:43.14+00:00

Short: My application's nodeJS backend is not running in Azure App Service.

The app does successfully build, go through the workflow, and launches the frontend.

After the backend of my application is deployed, no script is able to start the server.ts file that runs the whole thing. I initially thought it was related to the startup commands, but no iteration of the available commands worked. On top of that, I reconfigured ports to work with port 443, as opposed to the 3000 that it previously ran. A js version also does not work well.

In the SSH terminal, I noticed that some of the npm commands did not work and the server.ts file was not able to be interpreted (as typescript). It also was not being built into dist. My frontend works fine, but there is no successful ping from the backend to the frontend. Trying to directly go to the url takes me immediately to the frontend. I am not getting a 503 error.

My current config scripts are as follows:

"scripts": {
   "dev": "vite",
   "build": "tsc -b &&  vite build --base=./",
   "lint": "eslint .",
   "preview": "vite preview",
   "serverStart": "nodemon src/server.ts",
   "server": "node src/server.ts",
   "start": "tsx /src/server.ts",
   "docker-acs": "docker-compose up",
   "acs": "cd azure-communication-server && tsx azure-communication-server.tsx"
},


I am primarily using serverStart.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,935 questions
{count} votes

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.