Graph PowerShell 2.41.0: Connect-MgGraph fails loading System.Text.Json 10; downgrading to 2.40.0 resolves
Mantenedores costumam responder em até 2 dias
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- azure, powershell
- Domínio
- api, authentication
Direção de pesquisa
Begin with the dependency change associated with #3789 and the Microsoft.Graph.Authentication entry point used by Connect-MgGraph; reproduce on the listed PowerShell and .NET versions. Trace the System.Text.Json 10 load path and verify that the callback connects on 2.41.0 without pinning 2.40.0.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Describe the bug
We encountered an assembly-loading failure at Connect-MgGraph after installing Microsoft Graph PowerShell 2.41.0. Pinning both Microsoft.Graph.Authentication and Microsoft.Graph.Groups to 2.40.0 (the previous version) appears to resolve the failure.
| Component | Version |
|---|---|
| OS | Ubuntu 24.04.4 LTS |
| PowerShell | 7.5.5 |
| PowerShell runtime | .NET 9.0.14 |
| Az.Accounts | 5.3.3 |
| Microsoft.Graph.Authentication | 2.41.0 |
| Microsoft.Graph.Groups | 2.41.0 |
This runs on an ephemeral Azure DevOps agent. An AzurePowerShell@5 task (using pwsh=true) invokes Redgate Flyway, which launches a child pwsh process for a deployment callback. Diagnostics from the task and a seperate child process both reported the runtime and available module versions above.
Expected behavior
We would expect to be able to roll forward without issue.
How to reproduce
The callback imports the following modules and connects using an access token obtained through Az.Accounts:
Import-Module Az.Accounts -ErrorAction Stop
Import-Module Microsoft.Graph.Authentication -ErrorAction Stop
Import-Module Microsoft.Graph.Groups -ErrorAction Stop
$azContext = Get-AzContext -ErrorAction Stop
$graphAccessToken = (
Get-AzAccessToken `
-ResourceTypeName MSGraph `
-TenantId $azContext.Tenant.Id `
-AsSecureString
).Token
Connect-MgGraph -AccessToken $graphAccessToken -NoWelcome
This fails with an assembly-loading error referencing:
System.Text.Json, Version=10.0.0.0
SDK Version
2.41.0
Latest version known to work for scenario above?
2.40.0
Known Workarounds
Rolling back to 2.40.0 works as expected.
- Installing the umbrella
Microsoft.Graphmodule does NOT resolve the failure. - Installing the .NET 10 SDK on the agent did not resolve the failure, but we did not validate that the PowerShell callback ran under .NET 10 (it is believed we'd need to upgrade PowerShell 7 to do this)
Debug output
No response
Configuration
No response
Other information
#3789 seems like the likely culprit, thoughts @svrooij ?
- Linguagem predominante
- C#
- Estrelas
- 901
- Forks
- 232
- Merge médio
- 2d 1h
- PRs com merge (30d)
- 26
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
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:feature
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 8/100
microsoftgraph/msgraph-sdk-powershell#3827 ·
Mantenedores costumam responder em até 2 dias
-
status:waiting-for-triage type:bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 22/100
microsoftgraph/msgraph-sdk-powershell#3822 ·
Mantenedores costumam responder em até 2 dias
-
Microsoft.Graph.Authentication dependency Microsoft.Graph.Authentication.Loader.dll is unsignedAbertastatus:waiting-for-triage type:bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
microsoftgraph/msgraph-sdk-powershell#3819 ·
Mantenedores costumam responder em até 2 dias
-
Connect-MgGraph on 2.41 crashes when making a connection with cert, fixes when using 2.39 or lowerAbertastatus:waiting-for-triage type:bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
microsoftgraph/msgraph-sdk-powershell#3816 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de microsoftgraph/msgraph-sdk-powershell
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
Mantenedores costumam responder em até 1 dia
-
dette technique priorité: basse zone: service
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
damiensabau/nexus-lobby#25 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
sebastienros/jint#4282 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 76/100
pyrevitlabs/pyRevit#3792 ·
Mantenedores costumam responder em até 1 dia