KUDU deployment script throws UNC path error

Mohit Mathur 0 Reputation points
2023-02-03T05:15:06.76+00:00

Application - Node | App Service - Windows

Error :
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx\xxxxxxxxxxxx\site\wwwroot'

CMD.EXE was started with the above path as the current directory.

UNC paths are not supported. Defaulting to Windows directory.

npm ERR! path D:\Windows\package.json

npm ERR! code ENOENT

npm ERR! errno -4058

npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open 'D:\Windows\package.json'

An error has occured during web site deployment.

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

1 answer

Sort by: Most helpful
  1. ajkuma 22,416 Reputation points Microsoft Employee
    2023-02-06T12:08:28.44+00:00

    @Mohit Mathur How exactly are you provisioning the deployment?

    Are you leveraging Windows or Linux App Service?

    Test to see if the WebApp works locally fine, to isolate the issue.

    As pointed in the error ‘UNC paths are not supported. Defaulting to Windows directory.` review file the path.

    App Service deploys files to the wwwroot folder.  You may verify if the deployment files are in root folder :(home\site\wwwroot).

    I suggest you to follow the steps outlined in the document:

    Configure a Node.js app for Azure App Service

    Just to highlight, yes 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 and to correctly set the start script in the package.json file.

    If you deploy your files by using Git, or by using ZIP deployment with build automation enabled, the deployment engine generates a web.config in the web root of your app (%HOME%\site\wwwroot) automatically if one of the following conditions is true:

    • Your project root has a package.json that defines a start script that contains the path of a JavaScript file.
    • Your project root has either a server.js or an app.js

    To isolate the issue further:

    1.Navigate through Kudu site on: https://<sitename>.scm.azurewebsites.net/api/logs/docker
    2.Review the logs / docker.log