Is there a file size limitation with Powershell Compress-Archive Zip using Windows Server 2016? - azure

I read a bunch of websites (included stack overflow posts and Microsoft website) about the file size limitation of 2GB
Microsoft Docs: Compress-Archive
"The Compress-Archive cmdlet uses the Microsoft .NET API
System.IO.Compression.ZipArchive to compress files. The maximum file
size is 2 GB because there's a limitation of the underlying API."
I have a PowerShell script to backup my Azure DevOPS projects using the Azure DevOPS RestAPI 5.0.
I download all my projects directly in zip format with the RestAPI then i use Compress-Archive to consolidate all the zipped projects into 1 "big" zip file
My total zipped projects files all together is equal to 5.19GB
After compressing to 1 big zip file with Compress-Archive, i got a zip file size of 5.14GB
I don't have any issue to uncompress it and I don't get any error although the 2GB limitation on the documentation.
I wonder if it's because i'm using Windows Server 2016 (so 64bits) so I don't have the 2GB file size limitation?
Anyone can confirm that? As the Microsoft documentation doesn't specify anything about it.
Indeed, they stipulate that the issue is due to the API limitation of System.IO.Compression
Microsoft Docs: system.io.compression.ziparchive
As my zip will continue to grow, i would like to be sure that the zip won't be corrupted due to a file size limitation.
I can indeed use a 3rd-party library like Zip64, 7Zip, ... but i would like to only use the built-in compress method from PS/.Net

The 2GB limitation is for single Files inside the zip.
For example, if you try to Expand a .zip with an 2.1GB file inside it, it will trow an error.

Related

Uploading large .bak file to Azure Blob through Powershell

So I am trying to create a powershell script which will upload a large (> 4GB) .Bak file to Azure Blob Storage but currently it is getting hung. This script works with small files which I have been using to test.
Originally the issue I was having was the requirement to have a Content-Length specified (I imagine due its size) so I now calculate the file size of the .bak file (as it varies slightly each week) and pass this through as a request header
I am a total powershell newbie, as well as being very new to Azure blob. (NOTE: I am trying to do this purely in powershell, without relying on other tools such as AzCopy)
Below is my script
Powershell Script
Any help would be greatly appreciated..
There are a few things to check. Since file is big, are you sure it isn't uploading? Have you checked network activity in performance tab of task explorer? AzCopy seems like a good option too that you can use from within Powershell, but if it's not an option in your case, then why not to use native AZ module for Powershell?
I suggest you using Set-AzStorageBlobContent cmdlet to see if it helps. You can find examples at Microsoft docs

Failure to unzip application packages in Azure Batch

I followed the guidance in this wiki page to create an application package for my Azure Batch pool, but now my nodes are stuck in an unusable state because it fails to unzip. I can't find anything in the documentation that talks about what kind of compressed file is acceptable here, other than "a zip file".
I have a collection of database files used for some genomic sequencing tools that I have stored in a folder structure, which I created a compressed archive with using tar -zvcf and gave a .zip extension to. That did not work, so I tried uploading the same file with a .tar.gz extension and it also failed.
The Batch Node is running the CentOS image Azure Batch recommends for container applications, and my startup task is not running in the context of the container.
Can anyone point me to documentation or personal experience that helps clarify what kind of files can be used for this? Thank you in advance!
Yes, you are correct, but let me emphasise on the confusion, tar is the different compress archive file format then zip i.e. more detail here: What is the difference between tar and zip? it is mentioned many times in the documentation you mentioned along with
Batch App Package feature only support *.zip format and hence changing file extension from *.tar to *.zip is not the right way as they are 2 different way they get compressed et. al.
Extra docs:
https://azure.microsoft.com/en-au/blog/application-packages-and-task-dependencies-now-available-on-azure-batch/
https://kb.winzip.com/help/winzip/AboutZIPsAndOtherArchives_4.htm
Thanks and hope it helps.

Azure convert blob to file

Some large disks containing hundreds of 30GB tar files have been prepared and ready to ship.
The disks have been prepared as BLOB using the WAImportExport tool.
The Azure share is expecting files.
Ideally we don't want to redo the disks as FILE instead of BLOB. Are we able to upload as BLOBs to one storage area and extract the millions of files from the tarballs to a FILE storage area without writing code?
Thanks
Kevin
azcopy will definitely do it and has been tested. We were able to move files from blobs to files using the CLI in Azure with the azcopy command.
The information provided below was proven not to be true.
Microsoft Partner told me yesterday there is no realistic way to convert Blobs to Files in the above-mentioned scenario.
Essentially, it is important to select either WAImportExport.exe Version 1 for BLOBS or WAImportExport.exe Version 2 for files. Information on this can be found at this location.
The mistake was easily made and done so by a number of people here: the link to the tool sent was to the binary version 1. Search results tended to direct users to version 1 but version 2 only appears only after deeper dig. Version 2 - seems to be an afterthought my Microsoft when they added the Files option to Azure. It's a pity they didn't use different binary names or build a switch into version 2 to do both and delete the version 1 offering.

CloudBerry PowerShell Multipart

I've written a powershell script to upload from a windows system to an Amazon S3 Bucket. The script successfully uploads all files, except those over 5Gb. I have the Cloud Berry Explorer Pro license which allows for multipart upload on files up to 5TB. However there is no flag for multipart on the powershell snapin documentation. Cloudberry support directed me here as they only support the GUI not the powershell snapin. When running my script I get the error
"WARNING: Your proposed upload exceeds the maximum allowed object size (5 Gb)".
So question is, does anyone know if there is a command line option, or another way to enable multipart upload to Amazon S3 using Cloudberry Explorer Pro's Powershell Snapin?
Set-CloudOption UseChunks=true
I'm looking for the same in Powershell.
I believe in GUI, the original chunking mechanism has been depreciated. I have not tested myself, but I assume Powershell option UseChunks=true is still using the old mechanism? If so, files may be split into multiple parts and not automatically recombined when they arrive on S3. The new GUI Multipart Upload facility sorts this all out for you.
Annoyed Cloudberry still advertise Powershell as a component of Explorer (Free & Pro), but don't support it, even for fully paid up PRO support customers.
We did purchase the cloudberry explorer pro license for the native multipart upload capability, but we wanted to automate it. I believe based on their documentation that the old chunk method is deprecated in favor of their new multi-part functionality. We wound up testing the options listed in the powershell documentation. Those options are as follows:
Set-CloudOption -UseChunks -ChunkSizeKB
"Defines a size of chunk in KB; files larger than a chunk will be divided into chunks."
We verified that this was successfully uploading files beyond the 5GB restriction to our S3 bucket. I attempted to get a response from Cloudberry as to whether this was the old Chunking method or the new Multi-Part method, but I was unable to get a straight answer. They confirmed that because we were using pro, this powershell option was supported, but they failed to confirm which option the powershell command was using.
From what I can tell it appears that Cloudberry's legacy chunking mechanism would actually just break the file into individual files and thus would appear in S3 as multiple files. The Chunk Transparency mechanism in Cloudberry Explorer would allow the multiple chunks to appear as a single file in the Cloudberry Explorer GUI only. Since I can see the file as a single file on the S3 side, I'm assuming that the powershell option uses the new Multi-Part functionality and not the legacy Chunking functionality. Again I was not able to confirm this through Cloudberry so it's speculation on my part.
However, I can confirm that using the powershell options above will get you around the 5GB upload limit when using powershell.

Upload lot of files to Azure Blob Storage

I have directory where is about 100 000+ subdirectories. In every subdirectory is from one to ten files. All files are images with content type = image/jpeg.
Together this files have size over 54 GB. Is there any chance to upload this files with structure
/orders/1000000003/12345468878.jpeg.
I know that BLOB is not hierarchical. I don't have Windows, i don't have Powershell, i don't have Visual Studio.
Any suggestions?
Use the full path of your files as blob names. To upload from Linux or Mac, you can use Azure CLI (available as an NPM package).
Even though the structure is not hierarchical, you can "emulate" directories by adding /'s to the path name.
There are multiple clients available for Mac that support Azure Storage; my favorite is Cyberduck: https://cyberduck.io/ (free)

Resources