Friday, 17 August 2018

409 Conflict: Could not write to local resource 'D:\home\site\wwwroot\ due to error'Could not find file 'D:\home\site\wwwroot\

409 Conflict: Could not write to local resource 'D:\home\site\wwwroot\ due to error'Could not find file 'D:\home\site\wwwroot\


ERRORS:

·     409 Conflict: Could not write to local resources:\home\site\wwwroot\abc.txt' due to error 'Invalid access to memory location. '

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


Reason for all these errors is.
            
APP SETTING KEY

WEBSITE_RUN_FROM_ZIP =  1 

This key persisted during slot swap operation. 

Please check the article for more details: 


Run-From-Zip is still in preview and hence removing the key bring back everything to work as expected. 




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



Monday, 9 July 2018

Function App | Unable to add function in Function App | Blank screen

Function App | Unable to add function in Function App | Blank screen


Issue:
  • Sometimes you are not able to create a new function under your existing function app.
  • Earlier You were able to add new function but now you are not able to add.
  • You are able to see only a blank screen.


Analysis :
When You report these types of issue, Please collect the network trace immediately.

Please follow below steps to collect the network traces,
•    Hit F12 on your browser
•    Refresh browser (F5) - This will clear session caches
•    Reproduce the issue.
•    Export network trace as HAR file (Save all as HAR on Chrome/Edge/IE)




Once you have network trace then you can open it through Fiddler which will definitely give some information about some of the API failure.

In my case, I observed a lot of API failure for the /api/functions api



While investigating this API failure I observed lot of messages related to Network,


As the message says something about Network I quickly verified  the network setting but I was getting this issue in other networks also that means this issue is not pertaining to the network.


I then checked  Storage Account for this function.



I further checked and confirmed about unavailability of storage account.  

Somehow my storage account was deleted by someone which was causing that issue. I created a new function app and was able to add a new function successfully.

So whenever you face this issue please check the network trace and storage account availability.

Feel free to add/update anything if needed.

Tuesday, 12 June 2018

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

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
               


I hope this is helpful. Feel free to add/update anything.


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


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


Azure Functions | Microsoft.Azure.WebJobs.Script.WebHost: Repository has more than 10 non-decryptable secrets backups

Microsoft.Azure.WebJobs.Script.WebHost: Repository has more than 10 non-decryptable secrets backups Issue : ·        The function runtime is...