Reduce PyPi azure-cli Package Bloat #30972
Labels
Azure CLI Team
The command of the issue is owned by Azure CLI team
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
feature-request
Milestone
Is your feature request related to a problem? Please describe.
I'm trying to install azure cli in a non-bloaty way, for use in containerized environments. Most ways of installing it (ubuntu debs, azure linux dockers) balloon the installation near 1GB. This is difficult when azure cli is just supposed to be one of many tools needed to run things in this image, not the whole picture.
I had much more success with a python-alpine image, uv package manager, and
uv pip install --system --prerelease=allow 'azure-cli>=2.66'
(following the developers install/build instructions).The real problem is this: even the pure python repo is fairly bloated.

Of all the deps are almost nothing compared to it, and this is without pre-compiling the bytecode, which adds another 300MB (not shown).
I really only need a few parts of the cli ; I don't need the entire azure cli ecosystem (I can't afford it).
But even worse than 300MB of cli commands I don't need, is that, (correct me if I'm wrong, but this is half the basis of this issue), most of it is depreciated or out of date?
Ex, it seems like most-all the size comes from old versions of the api?


Describe the solution you'd like
My chief suggestion would be to cull old api versions; one can always install an older version of az cli.
But if that would be problematic (tho simple), couldn't releasing or packaging slimmer builds be an option? Ex, a slim wherein only the latest api's are included?
Or, going the aws cli route, allowing the various subcommands to be installed as extras, by default installing "all", unless the subset is specified?
Describe alternatives you've considered
Short of hacking at the install itself, there's literally nothing else bloatwise to remove from a mere pypi install, unlike the other methods. Even so, 1/2->1GB +- compiled pyc is a bit much.
The text was updated successfully, but these errors were encountered: