Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-MgBetaEntitlementManagementAccessPackageAssignmentPolicy does not return policy lifecycle durationInHours #2132

Closed
tjrobinson opened this issue Jul 7, 2023 · 2 comments

Comments

@tjrobinson
Copy link

tjrobinson commented Jul 7, 2023

Background

Via the Azure Portal it's possible to configure a policy assignment to expire after a number of hours, not just a number of days:

image

Describe the bug

Get-MgBetaEntitlementManagementAccessPackageAssignmentPolicy doesn't return a durationInHours property, only durationInDays set to 0.

To Reproduce

Steps to reproduce the behavior:

$policy = Get-MgBetaEntitlementManagementAccessPackageAssignmentPolicy -AccessPackageAssignmentPolicyId REDACTED 
$policy.ToJsonString()

Response:

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#identityGovernance/entitlementManagement/accessPackageAssignmentPolicies/$entity",
  "id": "REDACTED",
  "accessPackageId": "REDACTED",
  "canExtend": false,
  "createdBy": "REDACTED",
  "createdDateTime": "2022-09-02T12:04:49.8100000Z",
  "description": "REDACTED",
  "displayName": "REDACTED",
  "durationInDays": 0,
  "modifiedBy": "REDACTED",
  "modifiedDateTime": "2022-10-12T12:10:41.8500000Z",
  "questions": [ ],
  "customExtensionHandlers": [ ],
  "customExtensionStageSettings": [ ],
  "accessReviewSettings": {
    "accessReviewTimeoutBehavior": "removeAccess",
    "durationInDays": 90,
    "isAccessRecommendationEnabled": true,
    "isApprovalJustificationRequired": true,
    "isEnabled": true,
    "recurrenceType": "halfyearly",
    "reviewers": [
      {
        "@odata.type": "#microsoft.graph.groupMembers",
        "id": "REDACTED",
        "description": "REDACTED",
        "isBackup": false
      }
    ],
    "reviewerType": "Reviewers",
    "startDateTime": "2022-09-06T22:59:59.9980000Z"
  },
  "requestApprovalSettings": {
    "approvalMode": "Serial",
    "approvalStages": [
      {
        "approvalStageTimeOutInDays": 14,
        "escalationApprovers": [ ],
        "escalationTimeInMinutes": 0,
        "isApproverJustificationRequired": true,
        "isEscalationEnabled": false,
        "primaryApprovers": [
          {
            "@odata.type": "#microsoft.graph.groupMembers",
            "id": "REDACTED",
            "description": "REDACTED",
            "isBackup": true
          },
          {
            "@odata.type": "#microsoft.graph.requestorManager",
            "managerLevel": 1,
            "isBackup": false
          }
        ]
      },
      {
        "approvalStageTimeOutInDays": 14,
        "escalationApprovers": [ ],
        "escalationTimeInMinutes": 0,
        "isApproverJustificationRequired": true,
        "isEscalationEnabled": false,
        "primaryApprovers": [
          {
            "@odata.type": "#microsoft.graph.groupMembers",
            "id": "REDACTED",
            "description": "REDACTED",
            "isBackup": false
          }
        ]
      }
    ],
    "isApprovalRequired": true,
    "isApprovalRequiredForExtension": false,
    "isRequestorJustificationRequired": true
  },
  "requestorSettings": {
    "acceptRequests": true,
    "allowedRequestors": [ ],
    "scopeType": "AllExistingDirectoryMemberUsers"
  },
  "verifiableCredentialSettings": {
    "credentialTypes": [ ]
  }
}

Expected behavior

The response includes durationInHours property or similar.

Module Version

ModuleType Version    PreRelease Name
---------- -------    ---------- ----
Script     2.0.0                 Microsoft.Graph.Authentication
Script     2.0.0                 Microsoft.Graph.Beta.Identity.Governance

Environment Data

$PSVersionTable

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

Additional context

I believe this problem originates in the underlying Graph API, and is not specific to the PowerShell modules but I wasn't sure where else to raise it. I would imagine this also means that it can't be created/modified via the Graph API either.

The documentation also makes no mention of this property:

https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.beta.identity.governance/get-mgbetaentitlementmanagementaccesspackageassignmentpolicy?view=graph-powershell-beta

@ghost ghost added the ToTriage label Jul 7, 2023
@tjrobinson tjrobinson changed the title Get-MgBetaEntitlementManagementAccessPackageAssignmentPolicy does not return policy lifecycledurationInHours Get-MgBetaEntitlementManagementAccessPackageAssignmentPolicy does not return policy lifecycle durationInHours Jul 7, 2023
@peombwa
Copy link
Member

peombwa commented Jul 7, 2023

That's right. The API does not currently support durationInHours. Only durationInDays is available. See available properties at https://learn.microsoft.com/graph/api/resources/accesspackageassignmentpolicy?view=graph-rest-beta#properties.

Please open a service feature request at https://developer.microsoft.com/graph/support for the API team to review your request.

This repository is intended for issues related to the functionality of the module. We may not be the best place to answer some queries that are tied to the functionality of the API.

@peombwa peombwa closed this as completed Jul 7, 2023
@ghost ghost removed the ToTriage label Jul 7, 2023
@tjrobinson
Copy link
Author

@peombwa Thanks - not sure how that got missed?

I've raised the feedback here if anyone else coming across this would like to help by upvoting it: https://feedbackportal.microsoft.com/feedback/idea/e719eaa2-f81e-ee11-a81c-000d3a7a48db

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants