0
votes

I am deploying a NODE JS app to an Azure App Service using Azure Devops pipelines, but it failes with the following error

##[error]Error: Failed to generate web.config. Error: ENOENT: no such file or directory, open 'D:\a\_temp\temp_web_package_09902550774824137\web.config'

But in my deploy step I have the generate web.config step so I am not sure why its not working?

1
Can you share your pipeline definition and the step on how to generate web.config?Hugh Lin
i would also suggest looking at this question - stackoverflow.com/questions/63872925/… I faced a similar issue and was able to solve it. i have even put full, working YAML files so you can compare and contrast.Jay

1 Answers

0
votes

Thanks for asking question! You may try below steps for troubleshooting the issue.

Check that the application is listening on the port provided by the PORT environment variable: process.env.PORT. You may use the WEBSITES_PORT app setting set to port.

Also,review the web.config and make sure the name of the main script file in the handlers section matches the main script file and the Web.config configuration for settings names/values.

Check that the nodeProcessCommandLine setting to ensure that the Node.exe is available at the correction location.

Also, In order for Kudu to detect a Node.js app, you need a package.json file and an app.js/index.js in the root of your folder. It's recommended to correctly set the start script in the package.json file https://docs.npmjs.com/misc/scripts#default-values

If the deployment steps run correctly, however, the app fails to start due to a missing npm package, note that only "dependencies" are installed, "devDependencies" are not installed by default.Try viewing the logs to fetch more details.