Does local cache solve the problem with locked files when deploying to Azure App Service? During the deployments, occasionally I experienced issue with files being in use by App Service and thus not overwritten with newer versions.

There are multiple recommendations to overcome this problem:


Run your app from the ZIP package directly
Stop your app or enable offline mode for your app during deployment (using App_Offline.htm)
Deploy to a staging slot with auto swap enabled.


I am exploring the local cache option, to fix a different problem, and it is not compatible with running from ZIP feature, as discussed here and here 

If I understand correctly, when using local cache, the ZIP with code is deployed to Storage Account, and then is loaded into memory on App Service restart.

Does this mean, the issue with locked files is eliminated by using local cache, since the code is not run from the same place where it's deployed to?
The answer is no, if you are using the recommended setup, which is:


App Service should have Staging and Production slots
Staging slot has Local Cache disabled
Production slot has Local Cache enabled
The following settings are configured as "Slot setting" aka "Sticky setting" - WEBSITE_LOCAL_CACHE_OPTION, WEBSITE_LOCAL_CACHE_SIZEINMB
The code is deployed to Staging slot
Staging slot is swapped with Production slot


For deployments to Staging, I created the following steps:


Shut down Staging slot by introducing App_Offline.htm (POST to SCM URI or can be part of artifact being deployed)
Wait for slot to stop before cleaning (probe the URL of Staging slot)
Cleanup wwwroot (post to SCM URI) - this is to clean unused files. Deployments are not incremental, so if it's important to have clean old files, you can introduce this step.
Deploy to Staging slot using az webapp deployment source config-zip
Remove App_Offline.htm (POST to SCM URI)


For swapping slots:


Check Staging slot is up and ready (probe the URL of Staging slot) - this one is useful when triggering deployment environments in Atlassian Bamboo when deployed to Staging. You need to wait for Staging to be up and loaded before swapping, otherwise issues may occur
Swap the slots using az webapp deployment slot swap


If you deploy directly to Production slot, and restart it right after (because of Local Cache enabled), then yes, there should be no file locks when using this method. But this creates the downtime during deployment, in contrast with deployments to Staging slot and swapping it with Production.