0
votes

I am using kudu console to redeploy my azure function actifacts, however when i try to delete old artifacts bin folder is failed to delete, i get 409 Conflict: Canot delete directory, it is either not empty or access is not allowed.

enter image description here

When i try to delete the function dll failed with 404 not found error as shown below. I cannot find any handle with function dll.

enter image description here

I have no APP Setting configured for WEBSITE_RUN_FROM_PACKAGE. Any idea why this behaviour and how to delete old artifacts and re-deploy new function artifacts?

Update I have toggled WEBSITE_RUN_FROM_PACKAGEV 0 to 1 and switched back to 1 to 0. Now i able able to delete the bin folder, looks like there is a process still using my function application dll but can not be found in process explorer. When function runtime is restarted the resource is released very weird!

1
can you check if you have write accessSajeetharan
@Sajeetharan yes i do have write access, i can delete other function related files and folders but not bin folder where i have my function application dllram4sof

1 Answers

0
votes

The reason for the WEBSITE_RUN_FROM_PACKAGE setting is that vs2019 is used for release, and vs2019 is released, which uses zip deploy.

Now if you want to modify or delete the file, the only way to do it is to set WEBSITE_RUN_FROM_PACKAGE = 0 and then modify it. In the current version of the function app, after modifying WEBSITE_RUN_FROM_PACKAGE = 0, all the contents in the wwwroot folder will be deleted.

(after testing, the function app created after April 1st and 2nd will have this phenomenon. Contact a Microsoft engineer to confirm This is normal expected behavior.)

If you want to modify the file, it is not recommended to use vs2019 to publish directly. It is recommended to use the command line to publish. Because of this you can read and write files under wwwroot.

func azure functionapp publish function_app_name --csharp --nozip --force 

For more details, you can refer my answer in below post.

How to change content dynamically after function is called in Azure function app