3
votes

I am trying to run an NodeJs app on Azure app services for Linux. After a failed deployment I would like to delete the wwwroot folder and start from scratch, but I am not able to delete it. I have tried using ssh, bash, ftp and the Kudu REST API, but every time the result is the same.

This is the response from the DELETE call:

{"Message":"Cannot delete directory. It is either not empty or access is not allowed."}

Looks like there's an hidden .bin folder inside /node_modules that is blocking the delete operation.

enter image description here

Any hint?

1
Please mention that its Azure app service for Linux (I was puzzled for a while until I saw Kudu mentioned), anyways an ideal way to make a new build is to do a fresh git push and delete the old code before that git commit. The folder rights don't belong to a single host in this case. Delete the contents if you will but always try to do any such stuff using the git deploymentsBrij Raj Singh - MSFT
problem is that I cannot delete the files, I get an access denied errorDavid Guida
Try stopping the Web App first (Portal or CLI). Then go to Kudu and wipe out node_modules.evilSnobu
did that already, was the first thing :(David Guida
Try rename (or move) to another file name see if it unblocks you. The file might be in weird state.Suwat Ch

1 Answers

3
votes

I ran into this same issue today and resolved it by deleting the following App settings from Azure; WEBSITE_RUN_FROM_ZIP and WEBSITE_RUN_FROM_PACKAGE (Both settings do the same thing, just different names).

This was following instructions in Vikas Guptas blog on 17 Aug.

Not sure if you are using VSTS (Azure devops) but it may be helpful to some people to know that using version 4 of Azure App Service Deploy automatically sets the Website_Run_From_Package flag.