Convert project to .NET 8 console application for cross-platform support
This PR converts the Azure Storage GZip Encoding tool from .NET Framework 4.5.2 to .NET 8, making it cross-platform and suitable for Linux environments including Jenkins pipelines.
Key Changes
Cross-Platform Support
The tool now runs natively on:
- Linux (x64) - Perfect for Jenkins pipelines and CI/CD systems
- Windows (x64)
- macOS (x64)
Self-contained executables are generated for all platforms, eliminating the need for .NET runtime installation.
Modernized Dependencies
- CommandLineParser: 1.9.71 → 2.9.1 (latest stable)
- Azure SDK: WindowsAzure.Storage 7.0.0 → Azure.Storage.Blobs 12.22.1 (modern Azure SDK v12)
- Logging: System.Diagnostics.Trace → Microsoft.Extensions.Logging (structured logging)
- Removed legacy dependencies now included in .NET runtime
Code Modernization
- Updated to async/await pattern for all Azure Storage operations
- Replaced legacy
CloudStorageAccountwith modernBlobServiceClient - Improved error handling and structured logging
- Updated CommandLineParser syntax for v2.x compatibility
- Better memory management and resource disposal
Project Structure
- Migrated to modern SDK-style project file
- Removed .NET Framework artifacts (packages.config, App.config, AssemblyInfo.cs)
- Enabled nullable reference types for better code safety
- Added build targets for self-contained executables
Usage Examples
Linux/Jenkins Pipeline:
./asge -e .css .js -f assets -r -c "${AZURE_STORAGE_CONNECTION_STRING}"
Windows:
asge.exe -e .css -f myContainer -r -a myStorageAccount -k <key>
Jenkins Pipeline:
pipeline {
agent any
stages {
stage('Compress Assets') {
steps {
sh './asge -e .css .js -f assets -r -c "${AZURE_STORAGE_CONNECTION_STRING}"'
}
}
}
}
All original functionality is preserved while adding cross-platform compatibility and modern .NET features.
Fixes #2.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
@stefangordon 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.
I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.