Access VM Shared Directory from Linux App Service - azure-web-app-service

we have the new asp.net core web application running on Azure as App Service.
Because of the backward compatibility, we have a bunch of files (from the old version of the application) stored on VM Windows machine running at Azure too. Those files must be there!
And we need to access them from Linux App Service as files and directories as they are.
We wanted to use File Share. But because of the App Service sandbox, it is not possible.
Any help?

As of now you have option of mounting or using azure storage with Linux App Service.
https://learn.microsoft.com/en-us/azure/app-service/configure-connect-to-azure-storage?tabs=portal&pivots=container-linux
You can think of using or moving your filesystem from Azure VM to azure storage and further use Linux App Service mounting to Azure Storage.
The above article contains video with every step on how to do that.

Related

Azure Linux Web App Service - System.IO.IOException: Readonly File Error

The web app already running on .NET Core 3.1 LTS with IIS (windows server 2019)
Recently, I deployed as an Azure Web App Service but I encountered a file write error.
The application trying to create a new file for some business requirement.
Error message; System.IO.IOException: Read-only file system
Has anyone encountered this problem on Azure Linux Web App?
Solved: The Azure Linux Web App Service doesn't support directly file uploading to a regular folder under the wwwRoot. If you can running on the linux web app service, you need to use blob / storage etc..
Azure web app recommends that the wwwroot folder has read and write permissions. Whether it's Linux or Windows, it's the same.
In addition, it is not recommended to put the content of file operations in the project directory. For example, excel files generated under a certain business or uploaded image files in the deployment file. And the files are recommended to be stored in azure storage.
From the information which you have provided we can understand that there is any issue in creating a file in a specific directory where you don’t have access to it.
Refer to this SO thread where we got the insights to disable read-only mode, thanks to MarkXA.
Make sure that you have provided correct path whether it is any storage account or local storage where you are getting files. Also, if possible, elaborate your questions with full error trace, path you are using to access.

Deploy the Static Azure WebApp from Dropbox

I have a Linux based Webapp and I am trying to deploy this static webapp deployment from dropbox and after I navigate to the Deployment Center, there is no option for Dropbox or OneDrive. What are the possible ways to find this?
If your app is Linux WebApp, it is currently not available. Because these deployment options are only available for Windows Web Apps, not for Linux Web Apps.
There are other current limitations on Linux platform:
App Service on Linux is not supported on Shared pricing tier.
2.You can't mix Windows and Linux apps in the same App Service plan.
Within the same resource group, you can't mix Windows and Linux apps in the same region.
The Azure portal shows only features that currently work for Linux apps. As features are enabled, they're activated on the portal.
When deployed to built-in images, your code and content are allocated a storage volume for web content, backed by Azure Storage. The disk latency of this volume is higher and more variable than the latency of the container filesystem. Apps that require heavy read-only access to content files may benefit from the custom container option, which places files in the container filesystem instead of on the content volume.
Please take a look at this doc for more info : Azure App Service

Mapping a virtual directory to mounted file location in Azure file storage

In azure file storage, I have mounted a drive to Azure File storage location.
This mounted drive has images which need to be referred by all web apps and app services. How do I created a virtual Directory using mounted drive? So that I can use the virtual directory to refer the images.
example : \\{filestoragename}.blob.core.windows.net\images\ mounted to the Drive Z:
How to create a virtual directory called "images" pointing to Z: in my Web Application. So image will be referred using the www.domainname.com/images/demo.jpg.
Web App has "Virtual applications and directories" section. But it throws the error as If I try to refer Z: Physical path.
I see, seems you are using code publish web app (common windows Web Apps) instead of Linux Web Apps or Windows Containers Web Apps (docker/container publish) .
If you use Linux Web Apps or Windows Containers Web Apps , you can mount Azure storage related resources here directly :
However, if you are using common windows Web Apps, the config menu looks like below :
common windows web apps can not mount Azure storage related resources directly.
The only way to access Azure storage resources here is using Azure storage REST API.
We have got an approach that login to the Virtual Machine where we hosted the web application , Open the IIS and create a Virtual Directory which is referring the Blob storage location.
Another approach is ....
We have decided to Configure a Azure custom domain for accessing blob data in your Azure storage account, like www.media.domainname.com.
This approach helps us to refer static images placed in one location.
No need create virtual directory for each web site.

How to access my old files(ftp - media files) in windows azure deployment?

I have migrated and deployed my asp.net (2010) application to windows azure cloud service.
I have small doubts here.
In my previous hosting my application files(media, documents) are located in the local folder of ftp site. And storage (db ) was in server. But according to windows azure i just deployed my application to cloud with db created in windows azure portal.
i). How can i use my previous files here?
I'd recommend you store the files that used to be in FTP in Azure Blob storage https://www.windowsazure.com/en-us/develop/net/how-to-guides/blob-storage/. If you put them to blob storage you can use something like Cloudxplorer http://clumsyleaf.com/products/cloudxplorer to browse them and upload them. If you really want to use FTP (which I'd not recommend as it an insecure protocol) there is also a blob storage to FTP bridge http://ftp2azure.codeplex.com/

Client-Side: Accessing Windows Azure Drive?

I am developing an Azure application, part of which involves users browsing an online filesystem. TO do this, I am trying to use the Windows Azure drive, but I can't figure out how to access it from client side, or how to make it accessible on the server side.
At the moment, I only know how to make the drive:
CloudStorageAccount devStorage = CloudStorageAccount.DevelopmentStorageAccount;
CloudBlobClient client = devStorage.CreateCloudBlobClient();
CloudBlobContainer container = new CloudBlobContainer("teacher", client);
CloudDrive.InitializeCache(localCache.RootPath,
localCache.MaximumSizeInMegabytes);
CloudDrive drive = new CloudDrive(container.GetPageBlobReference("drive1").Uri, devStorage.Credentials);
drive.Create(50);
I am using C# as my development language.
All help is greatly appreciated!
There are couple of things you need to understand with Windows Azure Cloud Drive:
Cloud drives are actual Page Blobs which are stored on Windows Azure Blob storage and mount as a drive (you will get a drive letter depend on your machine drive statistics) in a machine where you can provide Windows Azure Run time environment.
Programmatic it is very easy to mount a cloud drive in your code as you showed in your example however one thing is missed that is to be sure to have Windows Azure RunTime environment where this code can run.
I have written a utility to mount azure drive within Windows Azure VM (Web, Worker or VM Role) located here:
http://mountvhdazurevm.codeplex.com/
You can run above tool directly in Windows Azure VM and can also this the exact same code in your Compute Emulator (Windows Azure Development Fabric) so the bottom line is as long as you can provide Windows Azure Runtime environment, you can mount a Page blob VHD drive.
I have seen several cases where someone asked me to mount a Windows Azure Page Blob as drive in local machine (client and server, anywhere) and the actual hurdle was to bring Windows Azure Run time in local environment because it is not available. In some cases a few person went ahead and tries to use Windows Azure SDK to have Windows Azure runtime made
available in their desktop, created a dummy web role and then mount the VHD which was mounted in local machine and a drive letter was made available as well. I am not sure about such kind of solution because this is not Windows Azure compute emulator is designed.
Hope this description provide you some guideline.
I'm not sure I understand your question properly, but it sounds like you want multiple client applications - presumably on machines that are not on Azure - to access your Azure drive?
Unfortunately, Azure drives can only be accessed from Azure web/worker or VM role instances.
I've written a WebDAV Server which runs on an Azure Website which will allow clients, including Windows Explorer and Office to connect to Azure Storage. It uses a combination of Table and Blob Storage to store the file structure and files. I've tested it with Windows Explorer and Word 2013. Although this isn't a clouddrive solution it's still using Azure Storage as a backend and it's accessible from WebDAV clients. You might find it useful..
https://github.com/ichivers/AzureDAV
One additional point to the existing answers. You can always download the blob backing your Cloud Drive and mount it on a local system. The blob is really just a VHD. However, the download time isn't going to trivial unless the drive is small.
Erick

Resources