locked
Unzip file in azure storage RRS feed

  • Question

  • are there anyway I can upload a zip files to azure storage and unzip it ?

    upload can be using azcopy .

    how about unzip ? can use powershell ?

    Thursday, September 6, 2018 5:22 PM

Answers

  • Hi,

    You'll have to unzip the file and upload the contents. You cannot unzip within a storage account.

    Please refer to the following example, which will unzip your file with PowerShell and upload the contents to Azure Storage:

    $ZipFile = "C:\temp\mydata.zip"
    $Destination = "C:\temp\mydata"
    
    Add-Type -AssemblyName System.IO.Compression.FileSystem
    [System.IO.Compression.ZipFile]::ExtractToDirectory($ZipFile, $Destination)
    
    AzCopy /Source:C:\temp\mydata /Dest:https://myaccount.blob.core.windows.net/mycontainer /DestKey:key /S

    This will extract the contents of mydata.zip to C:\temp\mydata and upload the contents recursively (/S) to the Azure Storage account.

    If the folder in the $Destination path does not yet exist, ExtractToDirectory will create it.

    Best regards,

    John

    • Marked as answer by sakurai_db Sunday, September 9, 2018 3:41 PM
    Thursday, September 6, 2018 7:13 PM
  • Hello,

    Azure storage dont provide any services to unzip the files.

    you can upload the zip files and can unzip using any software


    Please Mark as Answer if my post works for you or Vote as Helpful if it helps you. Kapil Singh

    • Marked as answer by sakurai_db Sunday, September 9, 2018 3:41 PM
    Friday, September 7, 2018 6:05 AM
  • @Sakurai_ds, just checking in to see if the above response helped to answer your query. 

    • Marked as answer by sakurai_db Sunday, September 9, 2018 3:41 PM
    Sunday, September 9, 2018 2:45 PM

All replies

  • The Azure storage is just a storage. You can put Zipped content in to the Azure blob Storage, but you can't make the Storage Service to unzip it. You have to download the contents first, then unzip it.  

    If this answer was helpful, click “Mark as Answer” or Up-Vote. To provide additional feedback on your forum experience, click here

    • Proposed as answer by vikranth s Thursday, September 6, 2018 5:51 PM
    Thursday, September 6, 2018 5:51 PM
  • Hi,

    You'll have to unzip the file and upload the contents. You cannot unzip within a storage account.

    Please refer to the following example, which will unzip your file with PowerShell and upload the contents to Azure Storage:

    $ZipFile = "C:\temp\mydata.zip"
    $Destination = "C:\temp\mydata"
    
    Add-Type -AssemblyName System.IO.Compression.FileSystem
    [System.IO.Compression.ZipFile]::ExtractToDirectory($ZipFile, $Destination)
    
    AzCopy /Source:C:\temp\mydata /Dest:https://myaccount.blob.core.windows.net/mycontainer /DestKey:key /S

    This will extract the contents of mydata.zip to C:\temp\mydata and upload the contents recursively (/S) to the Azure Storage account.

    If the folder in the $Destination path does not yet exist, ExtractToDirectory will create it.

    Best regards,

    John

    • Marked as answer by sakurai_db Sunday, September 9, 2018 3:41 PM
    Thursday, September 6, 2018 7:13 PM
  • Hello,

    Azure storage dont provide any services to unzip the files.

    you can upload the zip files and can unzip using any software


    Please Mark as Answer if my post works for you or Vote as Helpful if it helps you. Kapil Singh

    • Marked as answer by sakurai_db Sunday, September 9, 2018 3:41 PM
    Friday, September 7, 2018 6:05 AM
  • @Sakurai_ds, just checking in to see if the above response helped to answer your query. 

    • Marked as answer by sakurai_db Sunday, September 9, 2018 3:41 PM
    Sunday, September 9, 2018 2:45 PM
  • what's the safe way to upload a big file around 100GB to azure storage ?

    Azcopy does have resume option ?

    Sunday, September 9, 2018 3:42 PM
  • AzCopy is good option to the blob file size level like you mentioned as 100GB similar to VM image blobs.
    Monday, September 10, 2018 9:26 AM