Azure Batch: zip created with 7-Zip failing as an application package
Observation on an Azure Batch application package: 7-Zip zip failing, Windows zip working, and how to compare archives.
During an automated deployment (Terraform) of an Azure Batch application package, a zip file created with 7-Zip did not work as an application package, while the zip created with Windows built-in compression did.
Compare the two archives
List each archive content with 7-Zip:
& "C:\Program Files\7-Zip\7z.exe" l -slt 1.0.0.zip
& "C:\Program Files\7-Zip\7z.exe" l -slt 1.0.4.zip
Observed differences:
- Windows zip: file entries only (full relative path),
Deflatemethod. - 7-Zip zip: explicit folder entries (
Folder = +,Attributes = D,Storemethod) in addition to the files.
Note
The exact cause is not established: this is an observation. If a Batch application package fails, try rebuilding the archive with the built-in Windows compression (for example Compress-Archive).