microsoftgraph / microsoftgraph/msgraph-sdk-powershell

Get-MgBetaIdentityGovernanceAccessReviewDefinition serialization issue with parameter scope

Open
#2,991 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Needs Investigation type:bug
Dominant language
C#
Stars
898
Forks
230
Avg merge
2d 5h
Merged PRs (30d)
31

Description

Describe the bug

the parameter scope retrieve the value Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphAccessReviewScope instead of the scope details

Expected behavior

should retrieve an object as retrieved in the debug trace

  "scope": {
    "@odata.type": "#microsoft.graph.accessReviewQueryScope",
    "query": "/beta/identityGovernance/entitlementManagement/accessPackageAssignments?$filter=(accessPackageId eq '<packageid>' and assignmentPolicyId eq '<policyid>' and catalogId eq '<catalogid>')",
    "queryType": "MicrosoftGraph",
    "queryRoot": null
  },
How to reproduce

(Get-MgBetaIdentityGovernanceAccessReviewDefinition -AccessReviewScheduleDefinitionId < id >).scope

SDK Version

2.24.0

Latest version known to work for scenario above?

No response

Known Workarounds

using invoke-mggraphrequest

Debug output
Click to expand log ``` DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://graph.microsoft.com/beta/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.22631; en-GB),PowerShell/7.4.5
Accept-Encoding : gzip
SdkVersion : graph-powershell-beta/2.24.0
client-request-id : 867b2885-b1ae-4cef-ba04-1b64bc600619

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
OK

Headers:
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : af126007-4c9d-415e-9ace-9a597947ba89
client-request-id : 867b2885-b1ae-4cef-ba04-1b64bc600619
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"UK South","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"LN2PEPF000114C9"}}
Link : https://developer.microsoft-tst.com/en-us/graph/changes?$filterby=beta,PrivatePreview:customData&from=2021-06-01&to=2021-07-01;rel="deprecation";type="text/html",https://developer.microsoft-tst.com/en-us/graph/changes?$filterby=beta,PrivatePreview:customData&from=2021-06-01&to=2021-07-01;rel="deprecation";type="text/html",https://developer.microsoft-tst.com/en-us/graph/changes?$filterby=beta,PrivatePreview:customData&from=2021-06-01&to=2021-07-01;rel="deprecation";type="text/html"
deprecation : Thu, 03 Jun 2021 23:59:59 GMT
sunset : Sat, 03 Jun 2023 23:59:59 GMT
odata-version : 4.0
Date : Tue, 08 Oct 2024 15:38:02 GMT

Body:
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#identityGovernance/accessReviews/definitions/$entity",
"id": "",
"displayName": "package - DSC - policy with access review",
"createdDateTime": "2022-11-22T18:55:08.5175414Z",
"lastModifiedDateTime": "2022-11-23T00:00:41.0384578Z",
"status": "InProgress",
"descriptionForAdmins": "",
"descriptionForReviewers": "",
"customDataProvider": null,
"customData": null,
"createdBy": {
"id": "",
"displayName": "",
"type": null,
"userPrincipalName": ""
},
"scope": {
"@odata.type": "#microsoft.graph.accessReviewQueryScope",
"query": "/beta/identityGovernance/entitlementManagement/accessPackageAssignments?$filter=(accessPackageId eq '< redacted >' and assignmentPolicyId eq '< redacted >' and catalogId eq '< redacted >')",
"queryType": "MicrosoftGraph",
"queryRoot": null
},
"instanceEnumerationScope": {
"@odata.type": "#microsoft.graph.accessReviewQueryScope",
"query": "/beta/identityGovernance/entitlementManagement/accessPackageAssignmentPolicies/)",
"queryType": "MicrosoftGraph",
"queryRoot": null
},
"reviewers": [
{
"query": "/v1.0/users/",
"queryType": "MicrosoftGraph",
"queryRoot": null
}
],
"backupReviewers": [],
"fallbackReviewers": [],
"settings": {
"mailNotificationsEnabled": true,
"reminderNotificationsEnabled": true,
"justificationRequiredOnApproval": true,
"defaultDecisionEnabled": true,
"defaultDecision": "Deny",
"instanceDurationInDays": 25,
"autoApplyDecisionsEnabled": true,
"recommendationsEnabled": true,
"recommendationLookBackDuration": null,
"decisionHistoriesForReviewersEnabled": false,
"recurrence": {
"pattern": {
"type": "absoluteMonthly",
"interval": 3,
"month": 0,
"dayOfMonth": 0,
"daysOfWeek": [],
"firstDayOfWeek": "sunday",
"index": "first"
},
"range": {
"type": "noEnd",
"numberOfOccurrences": 0,
"recurrenceTimeZone": null,
"startDate": "2022-11-23",
"endDate": "9999-12-31"
}
},
"applyActions": [],
"recommendationInsightSettings": []
},
"stageSettings": [],
"additionalNotificationRecipients": []
}

DEBUG: [CmdletEndProcessing]: - Get-MgBetaIdentityGovernanceAccessReviewDefinition end processing.

</details>


### Configuration

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Get-MgBetaIdentityGovernanceAccessReviewDefinition and reproduce the .scope output using the command and SDK version in the issue. Compare the returned value with the debug response's accessReviewQueryScope object; done means the scope exposes its query, queryType, and queryRoot details instead of only the model type name.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.