Unable to edit/delete files through KUDU site (409 conflict: could not write to local resource)

Azure | Unable to edit/delete files through KUDU site(409 conflict: could not write to local resource)


Scenarios

Edit Error

When you open any file in KUDU and try to save after updating, you may get this error.

409 conflict: could not write to local resource

DELETE Error

 When you try to delete the same file, you may get below error.



These errors are confusing. For example when you try to delete any file and get an exception, “404 Not found” but actually file is available in Folder and visible

Solution

This issue is pertaining to Files permission. You can check the permission of any file using below command,

attrib FileName

e.g.

attrib index.html

When we run this command, we will get details of all permission applied on that file,



We can clearly see that this file has been marked as “Read Only” and can’t be modified or deleted.
               
Once we remove this read-only permission using below command then the user will be able to edit/delete the file.

attrib -r index.html

          you can run attrib -r *.* to do them all at once.

Similarly, there might be some other permissions which can play an important role here.


Attrib

Displays, sets, or removes the read-only, archive, system, and hidden attributes assigned to files or directories. Used without parameters, attrib displays attributes of all files in the current directory.

Syntax

attrib [{+r|-r}] [{+a|-a}] [{+s|-s}] [{+h|-h}] [[Drive:][Path] FileName] [/s[/d]]

Parameters

+r   : Sets the read-only file attribute.
-r : Clears the read-only file attribute.
+a : Sets the archive file attribute.
-a : Clears the archive file attribute.
+s : Sets the system file attribute.
-s : Clears the system file attribute.
+h : Sets the hidden file attribute.
-h : Clears the hidden file attribute.


Please refer below URL for the complete list of Attrib command.


You can also use below alternative,
·         FTP
·         App Service Editor
               
If all these steps doesn't resolve your issue then you can check below URL to understand how to deal with locked file in Azure App Service

https://github.com/projectkudu/kudu/wiki/Dealing-with-locked-files-during-deployment

I hope this is helpful. Please share your query/feedback.


Other useful references,

Issue: Azure function is throwing one of the following exceptions
·       Unable to retrieve Functions Keys
·       We are not able to retrieve the keys for function
·       The function runtime is unable to start.
·       Function host is not running.
·       Internal Server error.
·       Service Unavailable.


Issue: Azure Functions: The Consumption pricing tier is not allowed in this resource group



Issue: Disable Azure functions



5 comments:

  1. This post really helped me to resolve my issue. Thanks a lot for publishing it.

    ReplyDelete
  2. Thanks for sharing this. Solved my issue.

    ReplyDelete
  3. I dont get an attribute saying R but i still cannot delete it. I keep getting 404 page not found error when i try to delete from kudu console. Any other ideas?

    on running that this is what I got
    attrib Newtonsoft.Json.dll

    A D:\home\support\mydll.Json.dll

    PS D:\home\support>

    ReplyDelete
    Replies
    1. Thanks for the feedback. Are you facing this issue with that web app only or with all other web apps.
      Have you tried stopping the web app and delete.
      Please try restarting your web app also.
      It that files is being used by any other process then it may not be deleted.

      Delete