microsoftgraph / microsoftgraph/msgraph-sdk-powershell

New or Set-MgEntitlementManagementAssignmentPolicy returns Invalid Model for any policy with reviewSettings on version 2.26 of the SDK

Aperta
#3,211 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Status: Needs Investigation type:bug
Lingua principale
C#
Stelle
898
Fork
230
Merge medio
2g 5h
PR unite (30g)
31

Descrizione

Describe the bug

We create and set access package assignment policies using Azure DevOps pipelines on Microsoft hosted agents. Recently the stage of the pipeline which does this has been failing.

After considerable troubleshooting of the model being passed to the API via the Set-MgEntitlementManagementAssignmentPolicy or New-MgEntitlementManagementAssignmentPolicy, we've identified that it would work consistently only when no reviewSettings were passed to the cmdlet.

If reviewSettings were passed, then Invalid Model was received, despite no changes having been made to the model and the model still being valid according to the Powershell/API reference.

We furthermore identified that the commands would accept reviewSettings when the image version of the agent was 20250209.1.0 or older, but always failed when 20250224.5.0.

Looking into the version history, one of the differences was that the version of Microsoft.Graph included in 20250224.5.0 was 2.26.1, but in 20250209.1.0 it was 2.25.0.

We've since used a task to specifically install Microsoft.Graph 2.25.0 on the agent, whatever version it runs, and the commands are consistency succeeding again. So there is an issue with these cmdlets in version 2.26.1 when reviewSettings are passed - or the accepted model has changed without this being reflected in the documentation.

Expected behavior

It should be possible to pass a reviewSettings object to either cmdlet.

The model passed is very similar to that in the example here - https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.identity.governance/new-mgentitlementmanagementassignmentpolicy?view=graph-powershell-1.0#example-2-code-snippet

And we also tried the exact model in the example, with the same error results.

How to reproduce

In an ADO pipeline, in a AzurePowerShell@5 task and on a windows-latest image on a Microsoft hosted agent, try to create an access package assignment policy with Set-MgEntitlementManagementPolicy and pass in parameters including a reviewSettings object like that in the example.

It will only fail if the image version of the agent selected is 20250224.5.0 or later.

SDK Version

2.26.1

Latest version known to work for scenario above?

2.25.0

Known Workarounds

Use another AzurePowerShell@5 task to manually install version 2.25.0 of the SDK using Install-Module 'Microsoft.Graph' -Scope CurrentUser -RequiredVersion 2.25.0 -Force -AllowClobber

Debug output
Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo il problema in un'attività AzurePowerShell@5 con New-MgEntitlementManagementAssignmentPolicy o Set-MgEntitlementManagementAssignmentPolicy e un oggetto reviewSettings. Confronta Microsoft.Graph 2.25.0 con 2.26.1 usando l'esempio della documentazione collegata; il lavoro è completato quando entrambi i cmdlet accettano reviewSettings senza errori Invalid Model.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
azure, powershell
Ambito
api, ci-cd
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.