1

I am trying to deploy an existing .Net application into Azure App Service. The website needs to store and retrieve files. When reading the docs for Azure Files I was under the impression that this was the way to go:

Azure Files offers fully managed file shares in the cloud that are accessible via the industry standard Server Message Block (SMB) protocol.

And

"Lift and shift" applications: Azure Files makes it easy to "lift and shift" applications to the cloud that expect a file share to store file application or user data. Azure Files enables both the "classic" lift and shift scenario, where both the application and its data are moved to Azure, and the "hybrid" lift and shift scenario, where the application data is moved to Azure Files, and the application continues to run on-premises.

But I cannot find that this is actually supported in App Service. Is there no way to store files from a App Service without changing code and implementing a Azure specific storage solution?

Jonatan B
  • 25
  • 1
  • 5

2 Answers2

1

Azure Files isn't going to do what you want here. Azure Files is SMB storage, intended for access from Virtual Machines, on Prem Machines etc. You could get your Web App to use, but you would need to talk to it's REST API, so you would need code changes. You can't mount Azure files into your web app directly.

If your able to make changes to your code, you would be best to look at using blob storage, which is the same service as Azure Files, but without the SMB API on top, which you can't use anyway. This still requires talking to the REST API.

If you can't make any changes then your pretty much limited to using the storage that comes with your app service, which is mounted to your web app.

Sam Cogan
  • 38,736
  • 6
  • 78
  • 114
  • This answer is now outdated as we are currently using Azure File Shares from App Services. This can be done via Configuration > Path Mappings > New Azure Storage Mount in your App Service – ShaneC Aug 18 '21 at 14:26
  • @ShaneC I'm able to get the drive mapped, but how are you accessing the \mount\name within the webservice app? from code? or virtual directly? Thx. – Steve Montgomery Dec 14 '22 at 23:12
  • @SteveMontgomery I'd suggest asking your own question, as this one is 3 years old. – Sam Cogan Jan 05 '23 at 11:10
0

I found this blog post that applies an IIS-level hack to the WebApp to allow you to mount the drive. It seems to be working just fine so far.