Move file in Azure Storage to shared network directory - azure

The workflow/function (calling it like that as I do not know how) should be in Azure.
Modern A application can write to Azure not to shared directory
Legacy B application can read from shared directory not Azure
A sends file to Azure
Azure sends file to shared directory
Is 2. possible?
Update:
I can use azcopy but I have to run it locally. Could I put this command into "something" in Azure that would run it at regular intervals?

Using Azure File Storage, application A can store the data on a storage account (which lives on Azure), and also, application B can mount a network drive pointing to Azure File Storage.
Application A can upload a file like this (assuming it's using c#):
https://learn.microsoft.com/en-us/dotnet/api/overview/azure/storage.files.shares-readme
Application B will mount like this:

Related

Doubts with Designing an Azure web app file manager

I am designing a web application and it needs to be in the Azure web app. The app is focused on managing files, so it needs to upload files and store them.
As is a cloud app, I suppose that I am not able to create a directory in the web app service. My question is if I have to use the benefits of Azure and create a Storage Account and if this is the solution, What will be the best storage solution, Blob or File?
Thank you in advance.
Best wishes
Container is a Blob Storage, which is a great option for programmable storage, where our program can read and write to the storage account.
If we don't want to allow websites and the public to access the files, we can choose the below options.
Blob Storage Containers can contain any binary files/ binary large objects, there is no ordering and hierarchy, we can have a virtual folder structure.
Containers are usually programmed to share files to access using Shared Access Signature and Access Policy
I suppose that I am not able to create a directory in the web app service
Azure Files is more useful for mounting a file share to a server and multiple servers can mount the same file share. It can have a quota.
File share has a Directory Structure, we can create Directories and Subdirectories in a Hierarchical manner compared to Containers.
The Connect option in the File Share gives you details on how to mount drive onto a Windows/Linux machine.
Use file storage if you need the shared drive protocol, if not we can design the applications and use blob storage.
As per your requirement, if you want to create Directories you can choose AzureFile Share.
Reference link Azure Blob and Fileshare storage mentioned by #deherman-MSFT

move file from azure vm to azure file storage

I have a Azure VM (Win 2016) where I have a folder where we have file coming every 5 minute.
Now I want to create and Window Service which will run on Azure VM and if any file exist, it will move to Azure File storage.
Could someone guide whats need to do or any other approach?
As I see it, you have 2 options:
Mount File Storage Share as a network drive. Once you mount the share as a network drive (and get a drive letter) you can simply use System.IO namespace to perform IO operations. Please see this link for more details: https://learn.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-windows.
Use Microsoft's Azure Storage SDK which is a wrapper over Azure Storage REST API and upload files from the local folder to the share in Azure File Storage. Please note that once the file is uploaded in Azure File Storage, you would need to manually delete the file from your server to achieve move operation.

How to copy files synced using azure files to a new azure storage location?

I have mapped my azure storage files in my local machine's network drive. now I want to copy the file from azures shared files location to a new location in azure storage whenever a new file is pasted in local machines network drive.
I followed this tutorial to mount azure files in my local machine.
Can anyone help me with copying those files from shared location to a new location in azure storage account?
What are the different approaches to achieve this scenario?
I want to copy the file from azures shared files location to a new location in azure storage whenever a new file is pasted in local machines network drive.
It seems that you mount your Azure File share on Windows and you'd like to monitor file additions/changes to local machine network drive and copy new file to another area (file share or blob).
You can try this approach: create and run a FileTrigger WebJob on your local machine to detect whether new files arrive, and use Azure Storage Services REST API or Microsoft Azure Storage Client Library to programmatic access and copy the new file to another file share or blob.

Azure: Is there a way to cache/reuse files downloaded from Azure blob storage?

I have a file upload/download service that uploads files to Blob storage. I have another service (a job service) that needs to download files from file service (using the blob storage URLs) and process those files. The files are read-only (they are not going to change during their lifetime). In many cases, the same file can be used in different jobs. I am trying to figure out if there is a way to download a file once and all the instances of my job service use that downloaded file. So can I store the downloaded file in some shared location and access it from all the instances of my service? Does it even make sense to do it this way? Would the cost of fetching the file from blob be the same as reading it from a shared location (if that is even possible)?
Azure also provide a file storage. Azure file storage provide a facility to mount that storage as a drive and access contain of azure file storage.
Buy for this you need to download it once and then upload to file storage.
Then you can mount that to any instance of virtual machine or local drive.
That is a alternate way to achieve your goal.
Check this
http://www.ntweekly.com/?p=10034

Run command line EXE on Azure, supplying a path to an Azure Blob

I have an Azure web app that stores documents in Azure blob "container X".
Now, we want to run a "job" to generate specialized reports for these documents.
This includes running an EXE file that takes a document path as argument, letting it generate a report on the file system, and uploading this to Azure blob "container Y".
Like: generate-report.exe document.doc generates report.txt.
How can this be done? Do we need to download the blob to the web app, or is it possible to somehow refer to a blob as we refer to a physical disk file?
You cannot refer to a blob as a local file object, since blob storage does not implement any type of file I/O abstraction layer. Yes, you can use File Storage service, which implements SMB on top of blob storage, but this is different than working with individual blobs.
If your app is built to deal just with file objects, you'd need to copy it from blob storage to local disk first, then upload the results from local disk to blob storage.
If you're just building your app, you can directly access blob content via the REST API (or one of the various language-specific SDK's that wrap the API).
Reading file from the blob can be done in form of stream that can later be used to create the text file inside the web app also.
You can also create web jobs under web app to accomplish this task in backend.
https://azure.microsoft.com/en-in/documentation/articles/storage-dotnet-how-to-use-blobs/

Resources