You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Subsequent commands using Get-Mg commands just fail with the following output for example: Get-MgIdentityGovernanceAccessReviewDefinition_List: The server responded with a Request Error, Status: NotFound
The only way to proceed is to re-run Connect-MgGraph.
It seems that the authentication is being broken and the commands do not gracefully handle the issue / complain about authentication in an explicit way.
Expected behavior
if authentication breaks, subsequent commands should throw an exception/error related to authentication.
Issuing a get method with Invoke-MgGraphRequest should not break authentication set by Connect-MgGraph
Debug Output
PS >Invoke-MGGraphRequest-uri "https://api.accessreviews.identitygovernance.azure.com/v1.0/identityGovernance/accessReviews/definitions/<AccessReviewID>/instances/<InstanceID>/contactedReviewers/`$count"-debug
VERBOSE: GET https://api.accessreviews.identitygovernance.azure.com/v1.0/identityGovernance/accessReviews/definitions/<AccessReviewID>/instances/<InstanceID>/contactedReviewers/$count with 0-byte payload
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): Y
DEBUG: GET /v1.0/identityGovernance/accessReviews/definitions/<AccessReviewID>/instances/<InstanceID>/contactedReviewers/$count HTTP/1.1
HTTP: api.accessreviews.identitygovernance.azure.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Microsoft Windows 10.0.19045; en-GB) PowerShell/7.2.16Invoke-MgGraphRequest
VERBOSE: received 0-byte response of content type
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): Y
DEBUG: GET https://api.accessreviews.identitygovernance.azure.com/v1.0/identityGovernance/accessReviews/definitions/<AccessReviewID>/instances/<InstanceID>/contactedReviewers/$count
HTTP/1.1404 Not Found
X-Powered-By: ASP.NET
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Date: Tue,14 Nov 202315:54:35 GMT
Content-Length: 0Invoke-MgGraphRequest: GET https://api.accessreviews.identitygovernance.azure.com/v1.0/identityGovernance/accessReviews/definitions/<AccessReviewID>/instances/<InstanceID>/contactedReviewers/$count
HTTP/1.1404 Not Found
X-Powered-By: ASP.NET
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Date: Tue,14 Nov 202315:54:35 GMT
Content-Length: 0
PS >$AccessReviews=Get-MgIdentityGovernanceAccessReviewDefinition-All -debug
DEBUG: [CmdletBeginProcessing]: -Get-MgIdentityGovernanceAccessReviewDefinitionbegin processing with parameterSet 'List'.
DEBUG: [Authentication]: - AuthType: 'AppOnly', TokenCredentialType: 'ClientSecret', ContextScope: 'Process', AppName: '90 Day Access Review'.
DEBUG: [Authentication]: - Scopes: [AccessReview.ReadWrite.Membership,Group.Read.All,AccessReview.ReadWrite.All,Group.Create,User.Read.All,Mail.Read,AccessReview.Read.All,Mail.Send,GroupMember.ReadWrite.All].
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
GET
Absolute Uri:
https://api.accessreviews.identitygovernance.azure.com/v1.0/identityGovernance/accessReviews/definitions
Headers:
FeatureFlag : 00000043
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.19045; en-GB),PowerShell/7.2.16
Accept-Encoding : gzip
SdkVersion : graph-powershell/2.9.0
client-request-id : f24c7b00-e972-4e87-80f9-0c0235b570f1
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
NotFound
Headers:
X-Powered-By : ASP.NET
X-Content-Type-Options : nosniff
Strict-Transport-Security : max-age=31536000; includeSubDomains; preload
Date : Tue,14 Nov 202315:56:30 GMT
Body:
Get-MgIdentityGovernanceAccessReviewDefinition_List: The server responded with a Request Error, Status: NotFound
DEBUG: [CmdletEndProcessing]: -Get-MgIdentityGovernanceAccessReviewDefinitionend processing.
However, when you call Invoke-MgGrphRequest with graph's base url (https://graph.microsoft.com/v1.0) within the same session, you won't get an error for subsequent cmdlet executions. Therefore, it's not really an authentication issue.
I'm not sure why this has been marked as author feedback. What exactly is it you need from me? The bug is outlined in my original comment and also confirmed by timayabi2020 please can this be assigned to someone to fix?
Having stumbled on the same problem: Invoke-MgGraphRequest -Uri <some_URI> overwrites a global / environment variable so that subsequent calls to other MgGraph cmdlets use <some_URI> instead of the standard https://graph.microsoft.com/v1.0 base URI
Describe the bug
Running the following command breaks my authentication I'd previously configured with Connect-MgGraph:
Subsequent commands using Get-Mg commands just fail with the following output for example:
Get-MgIdentityGovernanceAccessReviewDefinition_List: The server responded with a Request Error, Status: NotFound
The only way to proceed is to re-run Connect-MgGraph.
It seems that the authentication is being broken and the commands do not gracefully handle the issue / complain about authentication in an explicit way.
Expected behavior
Debug Output
Module Version
Environment Data
PSVersion 7.2.16
The text was updated successfully, but these errors were encountered: