move file from azure vm to azure file storage - azure

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.

Related

Move file in Azure Storage to shared network directory

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:

Not able to get the folder path of azure storage gen2 of file systems

I have created a logic app,i'm reading file from datalake and need to load that to storage gen2 in azure.I have created connection for storage gen 2 using the action azure file storage and need to create the file in the file system.i have full access for the azure storage gen 2.But i'm not able to see the folder path for that connection.Can some one help me on this issue?
Thanks in advance.Below is the screen shot
https://lh3.googleusercontent.com/-e4yK5j6dYG0/XNwThtU9HCI/AAAAAAAABfg/MqodPgFOTqA5u1Owg7sTVd8VNuhau1LOwCK8BGAs/s0/2019-05-15.png
I test if you don't have File share, in the Logic App it will show no items.
So go to your Azure File Storage, add File share, then go to Logic App, refresh your page and it will show your File share.

Copy files from Azure Blob storage to Azure File Storage with Azure functions

I have files in Azure Blob Storage that I want to be able to share with users through an FTP server running on an Azure VM.
As I understand it you can't mount Blob Storage on a VM but you can mount an Azure File Share using 'net use'.
The files on the Blob Storage will be uploaded incrementally so ideally I would like to copy them to Azure files when they are uploaded and Azure Function seems like the ideal way since they are easy to set up and handle the trigger on the Blob Storage for me.
How would I go about copying a file from Blob Storage to an Azure File Share using an Azure function?
You can setup a Trigger Binding on the Azure Function to be triggered by Blobs in the Azure Blob Storage Container. Then you'll have to download the file stream of the blob and upload it to the Azure Storage File Share.
Azure Functions do not include support for an Output Binding directly to an Azure Storage File Share. So, you'll need to either use the Azure Storage SDK from in code, or look into mounting the File Share to the Azure Functions runtime environment so you can write file updates to it from within the Azure Function.
An alternative solutions would be to use Azure Logic Apps to implement this without writing any code. This article might help for integrating with an Azure Storage File Share -> Connect to on-premises file systems form logic apps with the File System connector

Is there any trigger for Azure File Share in azure functions or azure logic app?

I created file share in the azure storage account after that I mount the file share with my windows pc. Next I uploaded the files into file share drive for example (Z://), but whenever I uploaded files into OnPremise file share drive, then I want to trigger either logic app or azure function automatically and give the file/image to computer vision api and store the response into azure SQL database.
For that I followed the below documentations as
Extract Text From Images Using Computer Vision API And Azure Function
Computer Vision
But those are related to azure blob storage, but not an azure file share.
Actually, there is no trigger for Azure File Share.
Here is a similar post, refer to it. This is the feedback, you could vote it.

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

Resources