Azure: 409 Conflict: Cannot delete directory. It is either not empty or access is not allowed

牧云@^-^@ 提交于 2020-05-14 18:24:06

问题


I use Azure with node js App Service. When i try to delete empty folder using ftp or kudu app in node_modules folders i get error: 409 Conflict: Cannot delete directory. It is either not empty or access is not allowed. This folder is totally empty. How i can delete it?


回答1:


All Azure Web Apps (as well as Mobile App/Services, WebJobs and Functions) run in a secure environment called a sandbox. Each app runs inside its own sandbox, isolating its execution from other instances on the same machine as well as providing an additional degree of security and privacy which would otherwise not be available. For more details, refer to this article.

For directory level access please refer the below:

Home directory access (d:\home):

Every Azure Web App has a home directory stored/backed by Azure Storage. This network share is where applications store their content. This directory is available for the sandbox with read/write access.

The sandbox implements a dynamic symbolic link in kernel mode which maps d:\home to the customer home directory. This is done to remove the need of the customer to keep referencing their own network share path when accessing the site. No matter where the site runs, or how many sites run on a VM, each can access their home directory using d:\home.

Local directory access (d:\local):

This is a temporary directory and can be deleted when no longer needed. This directory is a place to store temporary data for the application. The application naturally has read/write access to this directory.

Note that the d:\local folder in the scm site (where Kudu runs) is not the same as the one in the main site (where the web app runs). As a result, they cannot see each other's local files.

Incase if you haven’t tried this already, use the rmdir directoryname /s /q command in Kudu Console to delete the directory and see if that works.

You can also run this command from Web App console. To access, Goto Web app -> Development Tools -> Console

Hope this helps.




回答2:


There is a Process explorer tab in the header.

  1. Open Process explorer
  2. Kill the task that's using the folder or file
  3. You will be able to delete the folder in question

This is how I resolved the same issue.




回答3:


Check AppSettings of Web App and delete the setting ‘WEBSITE_RUN_FROM_PACKAGE’ or changing the setting value to 0.

0 - write mode; 1 - read-only mode




回答4:


You may use the command api to do that. Craft a CMD or PowerShell command that'll clean your wwwroot and then execute it.




回答5:


Here is my solution: adding this option to your step deploying to the app service. Hope it would help

Options for deploying



来源:https://stackoverflow.com/questions/46362680/azure-409-conflict-cannot-delete-directory-it-is-either-not-empty-or-access-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!