microsoftgraph / microsoftgraph/msgraph-sdk-powershell

Invoke-MgFilterRoleManagementDirectoryRoleEligibilityScheduleRequestByCurrentUser not generating URL correctly

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

Nobody has claimed this yet.

AutoREST-dependency priority:p1 type:bug
Dominant language
C#
Stars
898
Forks
230
Avg merge
2d 5h
Merged PRs (30d)
31

Description

CC @peombwa

Related to:
https://github.com/microsoftgraph/msgraph-sdk-powershell/issues/1255

And I suspect the related other commands that use this syntax do not work as well

Describe the bug
The command generates the request URL as
https://graph.microsoft.com/v1.0/roleManagement/directory/roleEligibilityScheduleRequests/microsoft.graph.filterByCurrentUser(on='principal')

When it should be:
https://graph.microsoft.com/v1.0/roleManagement/directory/roleEligibilityScheduleRequests/filterByCurrentUser(on='principal')

Reference Docs: https://learn.microsoft.com/en-us/graph/api/privilegedaccessgroupeligibilityschedule-filterbycurrentuser?view=graph-rest-beta&tabs=http

Note the removal of the microsoft.graph section.

To Reproduce
Steps to reproduce the behavior:

  1. Invoke-MgFilterRoleManagementDirectoryRoleEligibilityScheduleRequestByCurrentUser -on 'principal' -debug

Expected behavior
List of requests by user

Debug Output

Run the problematic command with -Debug and paste the resulting debug stream below.
⚠ ATTENTION: Be sure to remove any sensitive information that may be in the logs.

DEBUG: [CmdletBeginProcessing]: - Invoke-MgFilterRoleManagementDirectoryRoleEligibilityScheduleRequestByCurrentUser begin processing with parameterSet 'Filter'.
DEBUG: [Authentication]: - AuthType: 'Delegated', TokenCredentialType: 'InteractiveBrowser', ContextScope: 'CurrentUser', AppName: ''.
DEBUG: [Authentication]: - Scopes: [].
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://graph.microsoft.com/v1.0/roleManagement/directory/roleEligibilityScheduleRequests/microsoft.graph.filterByCurrentUser(on='principal')

Headers:
FeatureFlag                   : 00000043
Cache-Control                 : no-store, no-cache
User-Agent                    : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.22635; en-US),PowerShell/2024.1.0
Accept-Encoding               : gzip
SdkVersion                    : graph-powershell/2.11.1
client-request-id             : fc39e141-230c-44a2-a128-ca2e8df8921b

Body:



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

Status Code:
InternalServerError

Headers:
Transfer-Encoding             : chunked
Vary                          : Accept-Encoding
Strict-Transport-Security     : max-age=31536000
request-id                    : 0c612ba8-5c5b-406c-aef5-334b6931747e
client-request-id             : fc39e141-230c-44a2-a128-ca2e8df8921b
x-ms-ags-diagnostic           : {"ServerInfo":{"DataCenter":"West US 2","Slice":"E","Ring":"1","ScaleUnit":"000","RoleInstance":"CO1PEPF000018B8"}}
Date                          : Fri, 12 Jan 2024 00:14:42 GMT

Body:
{
  "error": {
    "code": "InternalServerError",
    "message": "Unable to find target address",
    "innerError": {
      "date": "2024-01-12T00:14:42",
      "request-id": "0c612ba8-5c5b-406c-aef5-334b6931747e",
      "client-request-id": "fc39e141-230c-44a2-a128-ca2e8df8921b"
    }
  }
}

Module Version

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.11.1                Microsoft.Graph.Identity.Governance {Add-MgIdentityGovernanceAccessReviewDefinitionInstanceDecision, Get-MgAgreement, Get… 

Environment Data

Please run $PSVersionTable and paste the output below. If running the Docker container image, indicate the tag of the image used and the version of Docker engine.

Name                           Value
----                           -----
PSVersion                      7.4.0
PSEdition                      Core
GitCommitId                    7.4.0
OS                             Microsoft Windows 10.0.22635
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

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 the Invoke-MgFilterRoleManagementDirectoryRoleEligibilityScheduleRequestByCurrentUser command and trace how it builds the request URL. Reproduce the command with -on 'principal', compare the generated URL with the Microsoft Graph reference, and verify that the request lists the current user's requests without the microsoft.graph segment; check related commands using the same syntax as noted in the issue.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.