Upload Flat file from Local Directory to Azure File Shares - azure

I am looking for a way to upload a flat file to file.core.windows.net in Azure Storage. Uploading to a Blob storage is easy enough and straight forward using SSIS's Azure Blob Upload task, however I need the file to go to the File shares not the blob containers. I have tried to use AZCopy however I cannot seem to get it to work, so I was curious if anyone knew of an easier way to upload to the File Shares? I have access to the account name and Storage key for the upload.

I figured it out using AZCopy, I realized the instructions i received was from an older version of AZCopy with different keywords (Version 8 instead of the newest V10)

Related

Uploading folders on Azure Datalake storage failed using Azure Storage Explorer and python SDK both

I am trying to upload my on-premise data on the Azure Datalake storage, the data is about 10 GB in total and divided into multiple folders. I have tried multiple ways to upload the files, the size of each file varies from some KBs to 56MBs, and all are binary data files.
Firstly, I tried to upload them using the python SDK for azure datalake using the following function:
def upload_file_to_directory_bulk(filesystem_name,directory_name,fname_local,fname_uploaded):
try:
file_system_client = service_client.get_file_system_client(file_system=filesystem_name)
directory_client = file_system_client.get_directory_client(directory_name)
file_client = directory_client.get_file_client(fname_uploaded)
local_file = open(fname_local,'r',encoding='latin-1')
file_contents = local_file.read()
file_client.upload_data(file_contents, length=len(file_contents),overwrite=True,validate_content=True)
except Exception as e:
print(e)
The problem with this function is that either it skips the files from the local folder to upload, or some of the files uploaded do not have the same size as the local same local file.
The second method that I tried was by uploading the whole folder using Azure Storage Explorer, the storage explorer would crash/fail after uploading about 90 to 100 files. Is there any way I can see the logs and see the reason why it stopped?
Thirdly, I just manually uploaded using the Azure Portal, but that was a complete mess as it also failed on some files.
Can anyone guide me how to upload bulk data on the Azure data lake? And what could be the problem occurring in these 3 methods.
Uploading files using Azure Portal is easiest and reliable option. I'm not sure what exactly wrong you are doing assuming you have reliable internet.
I have uploaded around 2.67 GB of data carrying 691 files, and it got uploaded easily without any issue. Many files are 75+ MB size. Check shared image below.
If you can split your data into 4 group and then upload each group you can easily upload the files without any issue.
Another Approach
You can use AzCopy to upload the data.
AzCopy is a command-line utility that you can use to copy blobs or
files to or from a storage account.
It can easily upload large files with some simple command-line commands.
Refer: Get started with AzCopy, Upload files to Azure Blob storage by using AzCopy

Azure Storage : How to upload a .pdf or .docx file using Rest API

Recently I have been working on adding documents to Azure storage using blob and file share. But then I realized that in file share using rest API I can upload in two steps
Creating a file
Adding content
I am able to doing that but my requirement here is to upload the .pdf, .docx document at once
and then there should be a way to download them as well.
Could some one please help.
Thanks
Unfortunately, there's no batch download capability available in Azure Blob Storage. You will need to download each blob individually. What you could do is download blobs in parallel to speed things up.
There is an alternative way you can approach using C# or PowerShell.
Would recommend you to please go through this MS document :
https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-scalable-app-download-files?tabs=dotnet
And this one also
https://azurelessons.com/upload-and-download-file-in-azure-blob-storage/
Reference: How to download multiple files in a single request from Azure Blob Storage using c#?

Downloading parquet files from Azure Blob Storage. File and folder with same names

I have created parquet files on Azure Blob Storage. And now I want to download them. Problem is it keeps failing. I think its because the is a file and folder with same names. Why is that? Do I just need the folder? Since the file is only 0B?
The error I get looks like:
Its saying that because it already downloaded the 0B file
As mentioned in the comments, instead of downloading the actual file, you might have downloaded the Block Blob file which is an Azure's implementation to handle and provide FileSystem like access when the blob storage is being used as a filesystem (Azure HDInsight clusters have their HDFS backed with Azure Blob Storage). Object storage like Azure Blob Storage and AWS S3 have these sort of custom implementation to provide (or simulate) a seamless filesystem like experience.
In short, don't download the Block Blob. Download the actual files.

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

Azure Blob storage and HDF file storage

I am in the middle of developing a cloud server and I need to store HDF files ( http://www.hdfgroup.org/HDF5/ ) using blob storage.
Functions related to creating, reading writing and modifying data elements within the file come from HDF APIs.
I need to get the file path to create the file or read or write it.
Can anyone please tell me how to create a custom file on Azure Blob ?
I need to be able to use the API like shown below, but passing the Azure storage path to the file.
http://davis.lbl.gov/Manuals/HDF5-1.4.3/Tutor/examples/C/h5_crtfile.c
These files i am trying to create can get really huge ~10-20GB, So downloading them locally and modifying them is not an option for me.
Thanks
Shashi
One possible approach, admittedly fraught with challenges, would be to create the file in a temporary location using the code you included, and then use the Azure API to upload the file to Azure as a file input stream. I am in the process of researching how size restrictions are handled in Azure storage, so I can't say whether an entire 10-20GB file could be moved in a single upload operation, but since the Azure API reads from an input stream, you should be able to create a combination of operations that would result in the information you need residing in Azure storage.
Can anyone please tell me how to create a custom file on Azure Blob ?
I need to be able to use the API like shown below, but passing the
Azure storage path to the file.
http://davis.lbl.gov/Manuals/HDF5-1.4.3/Tutor/examples/C/h5_crtfile.c
Windows Azure Blob storage is a service for storing large amounts of unstructured data that can be accessed via HTTP or HTTPS. So from application point of view Azure Blob does not work as regular disk.
Microsoft provides quite good API (c#, Java) to work with the blob storage. They also provide Blob Service REST API to access blobs from any other language (where specific blob storage API is not provided like C++).
A single block blob can be up to 200GB so it should easily store files of ~10-20GB size.
I am afraid that the provided example will not work with Windows Azure Blob. However, I do not know HDF file storage; maybe they provide some Azure Blob storage support.

Resources