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



Azure | Some Files/Folders are not visible in KUDU or SCM site (KUDU File/Folder limit)

Azure | Some Files/Folders are not visible in KUDU or SCM site (KUDU File/Folder limit)

Issue

  • Why my files/folder are not visible in KUDU?
  • I can see folders/files in my local application but it is not visible in KUDU.
  • I know those folders are available there because without those folders my application will not work but somehow not visible in KUDU.
  • When I run "CD Folder_Name" command in KUDU console I am able to get into that folder but it is not visible in KUDU.
  • I can see those files/folders through FTP but not in KUDU.

Reason

I uploaded 338 items (files + folders) in KUDU and below is the result,


The limit for displaying the number of items is 299.

If you have more than 299 files or folder then some of them will not be visible due to this limitation.

This is by design and can be checked in KUDU code. You can clearly see MAX_VIEW_ITEMS = 300



The reason it doesn't display all is that performance becomes really bad with large folders. Thus it uses some algorithm in the backend to decide which files/folder should be displayed.

Solution

An immediate workaround which we can use,
  • Use “CD Folder_Name” command in KUDU Console.
  • Use FTP
  • Use App Service Editor

But still, if you want the folder to be visible in KUDU in spite of limitation then remember “Every problem has a solution in this world”. 😊

Please  use following steps,
  • if you are using chrome browser, go to your scm(kudu) site
  • open developer tools (F12)
  • in the console, run window.localStorage['maxViewItems'] = 300 (or any number)

I set the limit to 400.


And refresh the browser and here we go,


You can clearly see 338 items which I uploaded initially.

I am sure this will be very helpful.

Please refer below for more details,




Other useful references,


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


Issue: Azure function is throwing one of the following exception
·       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: Disable Azure functions