So I came across an interesting problem where immediately following a CI/CD deployment it appeared as if my entire Azure App Service site was broken. I logged into the site via Kudu and none of my files in wwwroot were available. After a frustrating few minutes I attempted to create a file from the Kudu command line terminal and saw this error message:
409 Conflict: Invalid access to memory location.
I got similar errors when trying to delete a directory:
409 Conflict: Cannot delete directory. It is either not empty or access is not allowed.
The problem appeared to be that my site assumed itself to be in read only mode, I literally could not create or delete a file without getting some variant of the 409 conflict error. This was, apparently, caused by an app setting called WEBSITE_RUN_FROM_PACKAGE set 1. This tells the site to go into read-only mode and is generally set during remote installation attempts from your CI/CD (it turns out I have a bad deployment zip file).
To resolve this problem I set WEBSITE_RUN_FROM_PACKAGE = 0 in the Configuration section of the Azure App Services followed by a service restart. Once I logged back into my KUDU site I magically saw all my files restored and was able to add or remove files at will.
Hopefully if you see any of these strange errors this helps you get back on track.
Comments are closed.