0

This is my first nestjs application (or any nodejs application for that matter) and I'm having trouble deploying it to a "production" environment. Steps I've followed:

1) I installed the Azure extension for VS Code

2) I click the blue up arrow icon in VS Code to initiate the deployment

3) The first time I tried, I had manually created my node JS application from portal.azure.com and chose that app service from the list, it didn't work

4) the second time I tried it, I created a new app service from the deployment process in VS Code

5) The application deploys and I get a deployment successful message. If I expand deployments under my new app service in the azure extension in VS Code, I see the deployment and when I select that, I get a log that finishes with this screenshot:

enter image description here

6) I try hitting an endpoint on my nestJS api from postman and I get an application error message that has a link to https://mywebsite.azurewebsites.net/detectors to troubleshoot. When I click that link, it fails to load in the azure portal

7) I read somewhere that I need to include my nodeJS version on the app service so I tried adding that - see screenshot below:

enter image description here

8) I can see the files if I use the SSH tool from the azure portal

enter image description here

a couple things to mention, I've read a few things that suggest I need to do something with "tsc"? in my package.json file. Since this is my first time doing anything with nestjs/nodejs, I have no clue what that means. I have not modified my package.json file (at least the scripts section) at all from how it comes out the box. Is there something I need to adjust there? Is there something I need to change on azure? I'm really liking nestjs a whole lot, but getting it to work in on my "real" server is proving to be a challenge...

any help is greatly appreciated.

TIA

Blair Holmes
  • 1,521
  • 2
  • 22
  • 35
  • Did you select 'Yes' on step 13 of https://learn.microsoft.com/en-us/azure/javascript/tutorial-vscode-azure-app-service-node-03? This forces `npm install` to run your app service. Also, try setting the startup command; it's on the Configuration Settings blade, to `npm run start` to start your server since I don't see an index.html in your dist. – Ryan Hill Apr 16 '20 at 03:00
  • @RyanHill-MSFT hey, thanks for responding. I posted a follow-up question the next day here: https://stackoverflow.com/questions/61232654/nestjs-to-azure-windows-app-service-web-config-settings with some more details as I got further along and I also got it working (solution in that post). – Blair Holmes Apr 16 '20 at 20:32

0 Answers0