Microsoft.Graph.Authentication is very large. How can we slim it down?
メンテナーはふだん 1 日以内に返信
@ramsessanchez がすでに取り組んでいます。
2025年11月10日 から。
評価
この issue はまだ評価されていません。
説明
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
- 主要言語
- C#
- スター
- 901
- フォーク
- 232
- 平均マージ
- 1日 5時間
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoftgraph/msgraph-sdk-powershell のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
microsoftgraph/msgraph-sdk-powershell#3752 ·
メンテナーはふだん 1 日以内に返信
-
status:waiting-for-triage type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoftgraph/msgraph-sdk-powershell#3751 ·
メンテナーはふだん 1 日以内に返信
-
status:waiting-for-triage type:bug
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
microsoftgraph/msgraph-sdk-powershell#3772 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
microsoftgraph/msgraph-sdk-powershell#3749 ·
メンテナーはふだん 1 日以内に返信
-
status:waiting-for-triage type:bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
microsoftgraph/msgraph-sdk-powershell#3741 ·
メンテナーはふだん 1 日以内に返信
microsoftgraph/msgraph-sdk-powershell の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SubtitleEdit/subtitleedit#15462 ·
メンテナーはふだん 1 日以内に返信
-
:watch: Not Triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
comp:instrumentation.aspnetcore
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
open-telemetry/opentelemetry-dotnet-contrib#5427 ·
メンテナーはふだん 1 日以内に返信
-
design-proposal
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
dotnet/aspnetcore#69592 ·
メンテナーはふだん 1 日以内に返信
-
Client Container Registry customer-reported needs-team-attention question Service Attention
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
Azure/azure-sdk-for-net#63470 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信