microsoftgraph / microsoftgraph/msgraph-sdk-powershell
Unable to create a new Conditional Access authentication context object
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 898
- Fork
- 230
- Merge medio
- 2g 5h
- PR unite (30g)
- 31
Descrizione
Describe the bug
When trying to create a new authentication context I get an error
New-MgIdentityConditionalAccessAuthenticationContextClassReference_CreateExpanded: Specified method is not allowed. Try GET, PATCH, DELETE
I tried to create it directly and using the BodyParameter.
New-MgIdentityConditionalAccessAuthenticationContextClassReference -DisplayName 'test context' -Id 'c2' -IsAvailable
and using the example in the MS docs link below.
This is an article for the beta module, the prod one doesn't have an example for whatever reason.
Expected behavior
Expected behavior is that the authentication context object gets created with the object id, name displayed.
How to reproduce
Run either of those:
New-MgIdentityConditionalAccessAuthenticationContextClassReference -DisplayName 'test authentication context' -Id 'c2' -IsAvailable
$AuthenticationContextBody = @{
id = 'c2'
displayName = 'test authentication context'
isAvailable = $true
}
New-MgBetaIdentityConditionalAccessAuthenticationContextClassReference -BodyParameter $AuthenticationContextBody
SDK Version
2.33.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
New-MgIdentityConditionalAccessAuthenticationContextClassReference_CreateExpanded: Specified method is not allowed. Try GET, PATCH, DELETE
Status: 405 (MethodNotAllowed)
ErrorCode: MethodNotAllowed
Date: 2025-12-11T09:21:28
Headers:
Cache-Control : no-cache
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : 8003e512-0000-0000-0000-a800072bd353
client-request-id : 000c793b-0000-0000-0000-a8005b5050b2
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"Sweden Central","Slice":"E","Ring":"3","ScaleUnit":"002","RoleInstance":"GV3PEPF00002BC3"}}
Date : Thu, 11 Dec 2025 09:21:27 GMT
Recommendation: See service error codes: https://learn.microsoft.com/graph/errors
Configuration
PSVersion 7.5.4
PSEdition Core
OS Microsoft Windows 10.0.22631
Other information
No response
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo la risposta 405 con New-MgIdentityConditionalAccessAuthenticationContextClassReference e l'esempio di BodyParameter della documentazione Microsoft Graph collegata. Confronta i cmdlet di produzione e beta e le relative operazioni HTTP documentate. Il lavoro è completato quando il flusso di creazione supportato crea correttamente un contesto di autenticazione con l'id, il nome visualizzato e le impostazioni di disponibilità forniti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- powershell
- Ambito
- api
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100