Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use "Azure File Storage" with Web App Service?

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".

like image 790
Jalal El-Shaer Avatar asked Nov 05 '15 13:11

Jalal El-Shaer


People also ask

How do I access my Azure storage on the web app?

In the Azure portal, go into your storage account to grant your web app access. Select Access control (IAM) in the left pane, and then select Role assignments. You'll see a list of who has access to the storage account.

Can I use Azure file as a file server?

Azure Files can be used to replace or supplement traditional on-premises file servers or network-attached storage (NAS) devices. Popular operating systems such as Windows, macOS, and Linux can directly mount Azure file shares wherever they are in the world.


2 Answers

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/.

like image 121
Gaurav Mantri Avatar answered Oct 22 '22 18:10

Gaurav Mantri


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.

like image 22
Kangur Avatar answered Oct 22 '22 18:10

Kangur