29

I have been struggling to find some resources that help explain, how we use the File Storage with Web App Service.

There are ways to use it with the old Web Roles, Check here (Using the Azure File Service in your Cloud Services (Web and Worker Roles)).

However, there is NO OnStart() methods in "Azure Web Service".

Edgar
  • 6,022
  • 8
  • 33
  • 66
Jalal El-Shaer
  • 14,502
  • 8
  • 45
  • 51

2 Answers2

18

If you're looking for mapping a drive to your Azure File Service share in your Web App using SMB protocol, then I don't think you can do as of today.

What you could do is make use of Azure File Service REST API and manipulate shares and files that way. You don't have to actually use the REST API per se; you can simply use the latest version of .Net Storage Client library which is a wrapper over REST API.

Please see this link for more details on how to use this using Storage Client library: https://azure.microsoft.com/en-in/documentation/articles/storage-dotnet-how-to-use-files/.

Gaurav Mantri
  • 128,066
  • 12
  • 206
  • 241
  • 10
    I confirm that you cannot map a drive to File Service today. This could potentially happen in the future. – David Ebbo Nov 05 '15 at 16:26
  • 2
    That would be a great addition. I have a scenario where an embedded database is used with my asp.net mvc application and I want to persist its data on Azure Files, hence the need for a sort of drive. Anyway, Azure Files feel more natural than blob storage, if they can provide this functionality. Then, future development will "feel" as simple as traditional old-school development style. – Jalal El-Shaer Nov 05 '15 at 22:40
  • 5
    Any update on this? I'm trying to do the same thing to enable a swift "Lift and Shift" of a legacy webforms application that right now had dedicated hosting on a VM and reads/writes images directly onto its C drive. So I'd like to be able to do it via a mapped drive. The REST APIs would not save me coding time. I found this article but its from 2014 and so far I'm getting access denied errors with it: https://blogs.msdn.microsoft.com/windowsazurestorage/2014/05/26/persisting-connections-to-microsoft-azure-files/ – Dan Csharpster Jun 13 '17 at 21:09
  • This feature has arrived. [You can map a drive to an azure file share](https://stackoverflow.com/questions/33545250/how-can-i-use-azure-file-storage-with-web-app-service) at this time. – Christopher Aug 16 '20 at 20:12
  • Feature documented there - https://learn.microsoft.com/en-us/azure/app-service/configure-connect-to-azure-storage?tabs=portal&pivots=container-linux – Luis Raúl Espinoza Barboza Aug 15 '22 at 18:20
  • Now it can be used with simple Windows based web apps.. no need it to be a container. – Mukeem Ahmed May 23 '23 at 02:45
10

Yes, you can. In Linux Web Apps and Windows Containers Web Apps only.

In the Web App, under Application Settings you will find Mount storage (Preview) section where you can mount Storage account. Works like a charm.

Kangur
  • 7,823
  • 3
  • 30
  • 32
  • Some elaboration or links might help – Jalal El-Shaer Feb 04 '19 at 09:05
  • 2
    Seems the UI is only available for Linux based app services https://blogs.msdn.microsoft.com/appserviceteam/2018/09/24/announcing-bring-your-own-storage-to-app-service/ – Carl Feb 15 '19 at 11:55
  • 2
    Not available for windows web apps: `Manage a web app's Azure storage account configurations. (Linux Web Apps and Windows Containers Web Apps Only)` – Carl Feb 15 '19 at 15:33
  • I find it astonishing that this is still the case. – Emperor Eto Feb 19 '20 at 15:44