msgraph-sdk-powershell icon indicating copy to clipboard operation
msgraph-sdk-powershell copied to clipboard

Update-MgEntitlementManagementAssignment no http resource found

Open jaoenrong opened this issue 6 months ago • 1 comments

Describe the bug

I am trying to update the schedule for an existing access package assignment with the -Schedule parameter, but it's throwing a now http resource was found error on the assignment ID, which was pulled directly with Get-MgEntitlementManagementAssignment cmdlet

Expected behavior

Either complete the update or return a syntax error on the -Schedule parameter

How to reproduce

$packagename='AccessPackage1'

$package=Get-MgEntitlementManagementAccessPackage -filter "displayname eq '$APname'" -all -ExpandProperty catalog,AssignmentPolicies

$filter="accesspackage/displayname eq '$APname'"

$assignments=@(Get-MgEntitlementManagementAssignment -ExpandProperty target,accesspackage,assignmentpolicy -filter $filter -All | ?{$_.state -ne 'expired'})

$schedule=@{ expiration=@{ EndDateTime=$null Type="noExpiration" } } Update-MgEntitlementManagementAssignment -AccessPackageAssignmentId $assignments[0].Id -Schedule $schedule

SDK Version

2.25.0, 2.28.0

Latest version known to work for scenario above?

No response

Known Workarounds

none

Debug output

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

HTTP Method: PATCH

Absolute Uri: https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/assignments/3cfbca2e -e0ce-4f01-9327-86285160147e

Headers: FeatureFlag : 00000043 Cache-Control : no-store, no-cache User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.26100;
en-US),PowerShell/2025.0.0 Accept-Encoding : gzip SdkVersion : graph-powershell/2.25.0 client-request-id : 1df96d8b-2150-4561-bcec-1a6c10b80c00

Body: Skipped: Content body was disposed before the logger could access it.

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

Status Code: NotFound

Headers: Transfer-Encoding : chunked Vary : Accept-Encoding Strict-Transport-Security : max-age=31536000 request-id : 0185b629-2dce-4d48-afa9-1861c6e5d07a client-request-id : 1df96d8b-2150-4561-bcec-1a6c10b80c00 x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"East US","Slice":"E","Ring":"5","ScaleUnit":"007","RoleInstance":"MN1PEPF0000F55E"}} Date : Wed, 21 May 2025 21:20:04 GMT

Body: { "error": { "code": "", "message": "No HTTP resource was found that matches the request URI 'https://igaelm-asev3-ecapi-cus.igaelm-asev3-environment-cus.p.azurewebsites.net/api/v1/assign ments('3cfbca2e-e0ce-4f01-9327-86285160147e')'.", "innerError": { "date": "2025-05-21T21:20:05", "request-id": "0185b629-2dce-4d48-afa9-1861c6e5d07a", "client-request-id": "1df96d8b-2150-4561-bcec-1a6c10b80c00" } } }

Confirm No HTTP resource was found that matches the request URI 'https://igaelm-asev3-ecapi-cus.igaelm-asev3-environment-cus.p.azurewebsites.net/api/v1/assign ments('3cfbca2e-e0ce-4f01-9327-86285160147e')'.

Status: 404 (NotFound) ErrorCode: Date: 2025-05-21T21:20:05

Headers: Transfer-Encoding : chunked Vary : Accept-Encoding Strict-Transport-Security : max-age=31536000 request-id : 0185b629-2dce-4d48-afa9-1861c6e5d07a client-request-id : 1df96d8b-2150-4561-bcec-1a6c10b80c00 x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"East US","Slice":"E","Ring":"5","ScaleUnit":"007","RoleInstance":"MN1PEPF0000F55E"}} Date : Wed, 21 May 2025 21:20:04 GMT

Update-MgEntitlementManagementAssignment : No HTTP resource was found that matches the request URI 'https://igaelm-asev3-ecapi-cus.igaelm-asev3-environment-cus.p.azurewebsites.net/a pi/v1/assignments('3cfbca2e-e0ce-4f01-9327-86285160147e')'. Status: 404 (NotFound) ErrorCode: Date: 2025-05-21T21:20:05 Headers: Transfer-Encoding : chunked Vary : Accept-Encoding Strict-Transport-Security : max-age=31536000 request-id : 0185b629-2dce-4d48-afa9-1861c6e5d07a client-request-id : 1df96d8b-2150-4561-bcec-1a6c10b80c00 x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"East US","Slice":"E","Ring":"5","ScaleUnit":"007","RoleInstance":"MN1PEPF0000F55E"}} Date : Wed, 21 May 2025 21:20:04 GMT At line:1 char:1

  • Update-MgEntitlementManagementAssignment -AccessPackageAssignmentId $ ...
  •   + CategoryInfo          : InvalidOperation: ({ AccessPackage...ageAssignment }:<>f__Anony  
     mousType431`3) [Update-MgEntitl..._UpdateExpanded], Exception
      + FullyQualifiedErrorId : Microsoft.Graph.PowerShell.Cmdlets.UpdateMgEntitlementManagemen  
     tAssignment_UpdateExpanded
    

DEBUG: [CmdletEndProcessing]: - Update-MgEntitlementManagementAssignment end processing.

</details>


### Configuration

Windows11 x64
Name                           Value
----                           -----
PSVersion                      5.1.26100.3624
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.26100.3624
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1


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

### Other information

_No response_

jaoenrong avatar May 21 '25 21:05 jaoenrong