I have hosted a MVC application on Azure using Cloud App service. The application has a document management module. Currently, I am storing the Documents uploaded by the user from application in Cloud App server. I have created a virtual directory which points to the Documents physical directory. The documents are stored in D drive. Whenever Azure machine reboots, my documents stored in the machine are lost.
What the better way of storing/retrieving files in an Azure hosted web application? Should I move my document management to Azure File Storage?
If you want to use normal Win32 API's for writing the file to storage then Azure Files is a great option - especially as it seems that you already have a working application. If instead you have control over how the files are written and don't mind updating to use Blob API's then you can also use Blobs.
Should I move my document management to Azure File Storage?
Yes. Or to Blob Storage or SQL, whatever suits your needs.
Related
I am new to Web-Development and have therefor maybe a beginner question.
So I am having a Web-App with an Angular Frontend und .Net backend, deployed on Azure.
Now users should be able to upload files (pdf, etc.) to the server which sould be stored permanetly. I would prefer to store them on a normal filesystem, so I don't want to use a database. Futhermore the files should be accessible for external services for futher processing.
I am not sure if that is possible with Azure App Services or if I need some other components. The only way I found to store files on the server is in the "wwwroot" folder. But I found no way to download them from the outside. Should I create a Web-API for that or do I think to complicated? Should I deploy my App somewhere else? What could be a way to implement this?
Thanks for any help.
You should use Azure Storage.
In Azure storage you can find mainly two options in your case. Blob and File Storage.
Blob is "more advanced" in a sense that it serves files on the browser, streaming video and audio etc.
File storage is a replacement of an on-premises file server.
Both options support file access by external services, and in addition to authorization, both are supported with Azure AD and shared access token.
When creating an Azure function with an Dedicated (Standard) App Service Plan the file service I'm expecting to get "linked" up isn't getting "linked" to the storage account. However the Storage account does get created correctly. When I go to the Azure Storage Accounts blade and find the file storage, Azure doesn't have the file service linked to the Storage Account. I don't see any linked File Shares when using the Windows desktop software, Microsoft Azure Storage Explorer (0.9.6).
When I go to the Azure Function's Advanced Tools (Kudo) I can see the storage account folders "Data", "LogFiles", and "Site" with the wwwroot I'm expecting to find. However due to certain network restrictions I can't upload the code through the web-site so that option is out.
When creating a Consumption based plan everything links up nicely and I can manage them in the Azure Storage Explorer app. How can I get my already created File Service File Share linked to my already created Azure Function so I can manage it in the desktop app and get things appearing correctly linked up in the Storage Explorer?
There's a solution for you to refer, as it works on my side.
In portal, Application Settings Tab, add two application settings below:
WEBSITE_CONTENTAZUREFILECONNECTIONSTRING storage account connectionstring
WEBSITE_CONTENTSHARE file share name
And some explanations for you.
When creating a function app, the storage account we specified is mainly used to store logs and files like host locks.
Only for function app created in consumption plan, it automatically adds the two application settings above and uses File Share to store whole function app by default.
As Azure document says, the File Share related settings is for consumption plan only. It seems not an expected operation for function created in app service plan, but it works in practice anyway.
Update
For a function app created in app service plan, assume its files are stored in place A(somewhere on the server). It works well and kudu displays files stored in A. So far it has nothing to do with file share.
Then we add the two settings, and assume the file share is B.
System retains old files(if exist) in B and creates an empty function app in it. From now on, system targets at and leverage files in B, as long as the "link"(two settings) exist. In portal, kudu or app service editor, we see files in B and also changes will be saved there.
And if we delete the "link", everything returns to A. Need to wait a little while for system "redirecting".
All explanation is based on my test(dozens of times) since it's an unexpected operation and has no document description.
I'm building an app involves user uploaded content (images, docs, pdfs) and would like to consider azure web apps for the hosting solution. Of particular interest is the deployment slot feature.
I understand that using the deployment slots prevents me from storing the user content in the filesystem.
I'm not excited about using blob storage for the user uploaded content because that really ties my app to Azure and would make it difficult to move to another host or implement a vendor redundant DR site. Database storage isn't all that exciting to me either.
Ideally the web app would have a virtual directory mapped to that blob storage but I understand that isn't a possibility.
Are there any good solutions to this issue?
You can add web apps to a virtual network that allow you to store content on file shares on other machines in the vnet. Doing so allows the webapp to communicate with other machines on the network where you can configure a file share.
You could point the website to the share via the web.config/application settings section of the portal to point deployment slots to different shares, etc.
Here's an official link: https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-create-vnet-arm-pportal/
After global overview about Windows Azure platform i still have some questions in my mind i would like you to kindly answer. Hope it will be also usefull for some people besides me.
One of my application uses sql server db for text data and second db which is just simply images db (folder structure own db) where
images are stored and by using ftp my aplication can download/upload
there. The question is: a) If i would go azure does "sql azure" is
place where can i place my sql server db? b) What about my folder
structure database - is there some place on azure storage i could put
my folders containing images and configure ftp to it? I heard about
BLOBS but can i ftp to it?
Is there possibility to place Windows forms application to Azure that it could work as remote application which specific users could
access instead of installing on every client machine?
Regarding Worker role - is there possibility to just simply move Windows service application to azure as worker role or there are some
things which has to be rebuilt to work in azure?
If i would go azure does "sql azure" is place where can i place my sql
server db.
You could definitely use SQL Azure to host your SQL database. Other alternative would be to use a SQL Server inside a Virtual Machine.
What about my folder structure database - is there some place on azure
storage i could put my folders containing images and configure ftp to
it? I heard about BLOBS but can i ftp to it?
Blobs is definitely the place to store files and folders though they don't support FTP. However there are many storage explorers available (both free and paid), using which you can upload files and folders from your local computer into Azure Blob Storage. Another alternative would be Azure File Storage.
Is there possibility to place Windows forms application to Azure that
it could work as remote application which specific users could access
instead of installing on every client machine?
Yes, it is possible. Please look into Azure Remote App Service.
Regarding Worker role - is there possibility to just simply move
Windows service application to azure as worker role or there are some
things which has to be rebuilt to work in azure?
You can't deploy a Windows Service application as is into a Worker role. You have to tweak your code a bit. Other alternatives that you may want to look into is hosting your Windows Service in a Virtual Machine (to the best of my knowledge, it should be without any code changes) or converting your Windows Service into a WebJob.
In addition to everything that Gaurav mentions and as he alludes to, you can also investigate Azure Files. You can mount file shares from any onprem application. Since Azure Files supports the SMB protocol, you can use standard file system API to interact with it.
https://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-files.
I'm considering moving from a dedicated server hosting environment to Azure. I'm using the ASP.NET Membership provider and every member has their own folder that houses their images (avatar, etc.). I have the Tinymce ImageManager wired up so that a logged-in user will only see their folder when selecting/uploading an image.
Is there a way to wire up the Tinymce ImageManager to Azure's blob storage in a similar way?
This thread on their site indicates that this is not yet supported:
http://www.tinymce.com/forum/viewtopic.php?id=24776
The only way I see this accomplished is for you to rewrite parts of the Image Manager that perform I/O operations on the HDD. Which is no a rocket-science to implement.
Another way to move to Azure is to move your site for Windows Azure WebSites.