Microsoft.Graph.Authentication is very large. How can we slim it down?
Mantenedores costumam responder em até 2 dias
@ramsessanchez já está trabalhando nisso.
Desde 10/11/2025.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
Is your feature request related to a problem? Please describe the problem.
Follow-up of #3345.
All of Microsoft.Graph.* depends on Microsoft.Graph.Authentication, weighing in at a whopping 42.1 MB on-disk with version 2.28.
Serverless environments frequently limit customers' space to deploy dependencies in. The PowerShell runtime+MS.Graph.Authentication is over 200MB of dependencies without having written any code, which poses several challenges for hosting/deployment.
There's been a lot of good discourse about the size of this SDK over the years (#692 #2475 #2516) - these have focused on either:
- The total size of the SDK, across all modules
- (MSGraph isn't that much bigger than
AWS.ToolsorAz)
- (MSGraph isn't that much bigger than
- Individual modules hitting landmark size limits
- (Not everyone uses those specific modules)
Even outside those two scenarios, module size is still a problem.
Comparing 3 separate auto-generated families of PowerShell modules:
| Metric | Az |
AWS.Tools |
Microsoft.Graph |
|---|---|---|---|
| Total Module Count | 93 | 410 | 47 |
| Total Installed Size1 | 514 | 737 | 1060 |
| Median Module Size | 3.1 | 1.2 | 9.5 |
| Core2 Module Size | 28.6 | 16.7 | 42.1 |
| Core : Total Module Size | 5.6% | 2.3% | 3.9% |
| "Average" Install3 Size | 31.7 | 17.9 | 51.6 |
1: All sizes in MB
2: Az.Accounts, AWS.Tools.Common, Microsoft.Graph.Authentication
3: Core module, plus single non-core (represented by median)
One "average" MSGraph module (with dependencies) is ~30% the size of the entire PowerShell Runtime on Linux. (~172MB)
Currently, Microsoft.Graph.Authentication has ~25MB of JSON used for Find-MgGraphCommand and Find-MgGraphPermission. These cmdlets appear to be for human-focused discovery/investigation and not required for authentication/API calls. Moving these off the critical dependency-path could save a ton of space for non-interactive scenarios.
Describe the solution you'd like.
TL;DR: Reduce .Authentication footprint to strict requirements for Invoke-MgGraphRequest or the other Microsoft.Graph.* modules. Move Find-MgGraph* to a separate module for interactive discovery.
Some options (neither exhaustive nor mutually exclusive) for making this work could look like:
- Move
Find-MgGraphCommandandFind-MgGraphPermissionto a separate module and add the module as a dependency ofMicrosoft.Graph. - Replace
Find-MgGraphCommandandFind-MgGraphPermissioninMicrosoft.Graph.Authenticationwith stubs to call corresponding commands inMicrosoft.Graph.CommandDiscovery, without setting explicit dependency relationships. - De-couple
Find-MgGraph*entirely from the rest of.Authentication.- Split
Microsoft.Graph.Authenticationinto two modules (.Commonand.CommandDiscovery, perhaps) - Update
.Authenticationdepend on.Commonand.CommandDiscovery - Update other child modules to depend on
.Common
- Split
Additional context?
No response
- Linguagem predominante
- C#
- Estrelas
- 898
- Forks
- 230
- Merge médio
- 1d 5h
- PRs com merge (30d)
- 23
Preparar o ambiente
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microsoftgraph/msgraph-sdk-powershell
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
microsoftgraph/msgraph-sdk-powershell#3752 ·
Mantenedores costumam responder em até 2 dias
-
status:waiting-for-triage type:bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
microsoftgraph/msgraph-sdk-powershell#3751 ·
Mantenedores costumam responder em até 2 dias
-
status:waiting-for-triage type:bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 72/100
microsoftgraph/msgraph-sdk-powershell#3772 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
microsoftgraph/msgraph-sdk-powershell#3749 ·
Mantenedores costumam responder em até 2 dias
-
status:waiting-for-triage type:bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
microsoftgraph/msgraph-sdk-powershell#3741 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de microsoftgraph/msgraph-sdk-powershell
Issues semelhantes
-
0 - Backlog Bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
BrighterCommand/Brighter#4444 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
-
area:frontend bug FE P3
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
klasolsson81/jobbliggaren#1915 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
microsoft/vscode-copilotstudio#431 ·
Mantenedores costumam responder em até 2 dias