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 9 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

The error does not get returned if running the command attempting no changes: Update-MgEntitlementManagementAssignment -AccessPackageAssignmentId $assignments[0].Id -debug

DEBUG: [CmdletBeginProcessing]: - Update-MgEntitlementManagementAssignment begin processing with parameterSet 'Reprocess'. DEBUG: [Authentication]: - AuthType: 'Delegated', TokenCredentialType: 'InteractiveBrowser', ContextScope: 'CurrentUser', AppName: 'Microsoft Graph Command Line Tools'. DEBUG: [Authentication]: - Scopes: [Application.Read.All, Application.ReadWrite.All, AppRoleAssignment.ReadWrite.All, AuditLog.Read.All, CustomSecAttributeAssignment.Read.All, CustomSecAttributeAssignment.ReadWrite.All, CustomSecAttributeDefinition.Read.All, CustomSecAttributeDefinition.ReadWrite.All, DelegatedPermissionGrant.ReadWrite.All, Directory.Read.All, Directory.ReadWrite.All, DirectoryRecommendations.Read.All, email, EntitlementManagement.Read.All, EntitlementManagement.ReadWrite.All, IdentityRiskEvent.Read.All, OnPremDirectorySynchronization.Read.All, OnPremDirectorySynchronization.ReadWrite.All, openid, Organization.Read.All, PeopleSettings.Read.All, Policy.Read.All, Policy.Read.ConditionalAccess, PrivilegedAccess.Read.AzureAD, profile, Reports.Read.All, RoleEligibilitySchedule.Read.Directory, RoleManagement.Read.All, RoleManagement.ReadWrite.Directory, User.Read, User.ReadBasic.All, User.ReadWrite.All, UserAuthenticationMethod.Read.All, UserAuthenticationMethod.ReadWrite.All].

Performing the operation "Update-MgEntitlementManagementAssignment_Reprocess" on target "Call
remote 'POST /identityGovernance/entitlementManagement/assignments/{accessPackageAssignment-id}/microsoft.g raph.reprocess' operation". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): a
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method: POST

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

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/7.4.7 Accept-Encoding : gzip SdkVersion : graph-powershell/2.25.0 client-request-id : 73890ad8-fdc1-44fd-a72f-488649d70a9b

Body:

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

Status Code: Accepted

Headers: Location : https://igaelm-asev3-ecapi-cus.igaelm-asev3-environment-cus.p.azurewebsites.net/api/v1/assignments('3cfbca2e-e0ce-4f01-9327-86285160147e')/Microsoft.IGAELM.EC.FrontEnd.ExternalModel.reprocess Strict-Transport-Security : max-age=31536000 request-id : 911ab173-8f3d-4b9b-a447-fe96b04dbc75 client-request-id : 73890ad8-fdc1-44fd-a72f-488649d70a9b x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"East US","Slice":"E","Ring":"5","ScaleUnit":"006","RoleInstance":"BL6PEPF0001B993"}} Date : Wed, 21 May 2025 22:05:19 GMT

Body:

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

jaoenrong avatar May 21 '25 22:05 jaoenrong

Duplicate of #3293 Closing.

gavinbarron avatar Oct 27 '25 20:10 gavinbarron