Does local cache solve the problem with locked files when deploying to Azure App Service?
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.