Is there any way to upload a file from an Azure File (not blob) to powershell

I want to upload a large file from Azure File storage using powershell,
I found all solutions are using Azure bolts, they cannot work with Azure files.

Can I upload a file from Azure Files?

[Note: because the file is very large (127GB) and it will take a long time to download it (may take 3 ~ 4 days), so it always breaks when I use my browser to download it]

below is the official doc: https://docs.microsoft.com/en-us/azure/storage/storage-powershell-guide-full

+3


source to share


2 answers


You can use the following cmdlets to download a file from Share from Azure.

$ctx = New-AzureStorageContext [storageaccountname] [storageaccountkey]
##sharename is your existed name.
$s = Get-AzureStorageShare [sharename] โ€“Context $ctx
##To download a file from the share to the local computer, use Get-AzureStorageFileContent.
Get-AzureStorageFileContent โ€“Share $s โ€“Path [path to file on the share] [path on local computer]

      

If you want to upload multiple files with one command, you can use Azcopy .



AzCopy /Source:https://myaccount.file.core.windows.net/myfileshare/ /Dest:C:\myfolder /SourceKey:key /S

      

See link for details.

+3


source


You can do this in three ways.

1. Azure Storage Explorer

Install azure store explorer on any windows, you can download files there

enter image description here

2. AZ COPY



Run below command in PowerShell to download file from azure blob

Execute a command like this powershell command

&'C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\AzCopy.exe' /Source:https://<STORAGE-ACCOUNT-NAME>.blob.core.windows.net/test-adf /Dest:'C:\Program Files\Microsoft SQL Server\MSSQL13.SQLEXPRESS\MSSQL\Backup' /SourceKey:<BLOB-KEY> /S /XO

      

3. Azure File Service

You can mount your blob as an external drive so you can easily copy the file

+4


source







All Articles