Assignment or Eligibility Role update by API not working error as per descriptions

VJ 25 Reputation points
2024-12-30T13:05:00.5933333+00:00

After set connect-MgGraph with scope using below command in powershell but getting error.
Code: $endDate = (Get-Date).AddYears(3).ToString("yyyy-MM-ddTHH:mm:ssZ")

$body = @{

scheduleInfo = @{

    expiration = @{

        endDateTime = $endDate

    }

}

} | ConvertTo-Json -Depth 10

Invoke-MgGraphRequest -Method PATCH -Body $body -Uri "https://graph.microsoft.com/v1.0/roleManagement/directory/roleEligibilityScheduleRequests/c569798f-db4c-42a7-ad4d-6254a098667d"

Error:

Invoke-MgGraphRequest: PATCH https://graph.microsoft.com/v1.0/roleManagement/directory/roleEligibilityScheduleRequests/c569798f-db4c-42a7-ad4d-6254a098667d

HTTP/2.0 404 Not Found

Cache-Control: private

Vary: Accept-Encoding

Strict-Transport-Security: max-age=31536000

request-id: 3670cdb3-415d-4ebc-93fc-cb06d7d4fe21

client-request-id: b309c503-4a30-4e46-b205-5eb2e785dd97

x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"Central India","Slice":"E","Ring":"3","ScaleUnit":"000","RoleInstance":"PN1PEPF00007039"}}

Date: Mon, 30 Dec 2024 12:56:48 GMT

Content-Type: application/json

Content-Encoding: gzip

{"error":{"code":"UnknownError","message":"{"message":"No HTTP resource was found that matches the request URI 'https://api.azrbac.mspim.azure.com/api/v3/roleManagement/directory/roleEligibilityScheduleRequests('c569798f-db4c-42a7-ad4d-6254a098667d')?'."}","innerError":{"date":"2024-12-30T12:56:49","request-id":"3670cdb3-415d-4ebc-93fc-cb06d7d4fe21","client-request-id":"b309c503-4a30-4e46-b205-5eb2e785dd97"}}}

Please help me for this issue i tried each way to update EndDate of assignment Role using API, if anyone know how to use API for update Assignment or Eligibility roles, please help me, any answers or input will be appreciate.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,689 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,714 questions
Microsoft Entra Private Access
Microsoft Entra Private Access
Microsoft Entra Private Access provides secure and deep identity-aware, Zero Trust network access to all private apps and resources.
70 questions
{count} votes

Accepted answer
  1. CarlZhao-MSFT 44,196 Reputation points
    2024-12-31T08:06:49.9866667+00:00

    Hi @VJ

    Currently, updating a principal's role eligibility request is not supported. You can only create a new eligibility request and cancel the old one.

    These are the methods supported by the API: https://zcusa.951200.xyz/en-us/graph/api/resources/unifiedroleeligibilityschedulerequest?view=graph-rest-1.0#methods.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.