Is it possible to copy files within an app service's wwwroot folder to another app service's wwwroot folder

Jake Killion 1 Reputation point

We have an app service which has files updated by user input and we want them to be copied over to another app service, ideally at deployment and not manual. Any ideas? All i have seen is solutions to move to and from Blob storages, storage accounts and dbs.


Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,046 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 49,251 Reputation points

    App services run in isolation so no, not directly. You can of course copy to an intermediary if you have configured permissions as part of your app service and then copy from there. Alternatively if you have strictly an Azure solution then perhaps an Azure Function or something that has access to both app services and can copy from one to another.

    But you said at deployment time so suddenly this doesn't make sense anymore. If you're deploying an app service then the files come from your deployment script. If that script wants to copy updated files then it would need access to the other file location (app service in your case) to copy from. This would be no different than copying from any other file location within the script but the script would need access to the app service, which is where the security challenges come in.

    Personally I would just have the source app write to shared storage somewhere (perhaps a file server or something) and have your deployment script pull from that. This seems the most secure and allows for you to update the files even if the source app service isn't running.

    0 comments No comments

  2. ajkuma 22,926 Reputation points Microsoft Employee

    @Jake Killion , Just checking in to see if the previous post by cooldadx helped answer your question.
    Kindly let us know if you have any further questions on this specific topic, we would be more than happy to assist you.

    To benefit the community find the right answers, please do mark the post which was helpful by clicking on ‘Accept Answer’ & ‘Up-Vote’.

    Just sharing additional info on App Service sandbox.
    All Azure Web Apps (as well WebJobs and Functions, etc) run in a secure environment called a sandbox.
    The sandbox itself runs in a Job controlled by the Azure Web App administrative service (the moral equivalent of WAS service in Windows).

    Azure Web App sandbox

    Operating system functionality on Azure App Service

    You may wish to know| if your requirement fits:
    --You can restore your app to a previous state, based on one of your app's snapshots. The platform automatically saves a hourly snapshot of each app's content and configuration for data recovery purposes.
    --Clone an existing App Service app to a newly created app in a different region or in the same region.

    Restore an app in Azure from a snapshot
    Azure App Service App Cloning

    0 comments No comments