title: Does each Azure "App Service" instance run on its own VM?
body: <p>(Note that I'm using the new "blade" Azure Portal exclusively and use the new terminology, so avoid words like "Azure Website" as they do not apply here).</p>
  
  <p>In the Portal I created two Azure App Services, "foo-production" and "foo-staging" - both exist in the same Subscription and Resource Group, and share the same App Service Plan. These App Services represent the production and staging deployments of a straightforward ASP.NET web application, which runs as a normal website.</p>
  
  <p>The App Service Plan is "Basic: 1 Small".</p>
  
  <p>My understanding is that when you use Azure App Services with a Basic or higher App Service Plan, that the Plan represents a VM which I'm able to host as many IIS websites as I want on - these IIS websites are represented in Azure as Azure App Services.</p>
  
  <p>Given this, one would assume when I access the filesystem of the VM in Kudu ( <a href="https://yourwebsite.scm.azurewebsites.net/DebugConsole" rel="noreferrer">https://yourwebsite.scm.azurewebsites.net/DebugConsole</a> ) that I would be able to see each website's files under some common root directory.</p>
  
  <p>However when I access the Kudu console for the <code>foo-production</code> website, I see that its files are in <code>D:\home\site\wwwroot</code> and files for <code>foo-staging</code> are not to be found.</p>
  
  <p>If I'm understanding this correctly, it means that Azure actually created a whole new VM just for each website and that websites cannot share a filesystem - and that I cannot have a more advanced Azure-managed IIS configuration - I'd have to create my own self-managed Windows Server VM.</p>
  
  <p>I can understand the motivation behind a separate VM for each website, it just seems wasteful - Windows Server requires at least a gigabyte of memory for each VM, yet my website is largely just static files (but I can't use a <code>Shared</code> App Service Plan because I need some of the more advanced functionality). That can't be economical for Microsoft then.</p>
  
  <p>How can I have multiple Azure App Services in an Azure-managed environment share the same VM? Or am I thinking about it incorrectly?</p>
  
  <p>To avoid an X/Y problem: I'll state that my primary concern is the persistence of files. The web-application I'm deploying stores uploaded files to a subdirectory of the webroot and those files should be there permanently. There is ambiguous information out there: some people suggest websites (and all their files) are actively destroyed and recycled and that Azure Storage Blobs should be used. I would like to use Azure File Shares, unfortunately I get <code>ACCESS_DENIED</code> errors when using <code>WNetAddConnection2</code> and some users report that Azure File Shares cannot be used from within Azure App Services - though I cannot find anything authoritative from Microsoft about this.</p>