Skip to content

Access delta link from delta cmdlets #2062

Open

Description

Customers can use the delta commands to list all changes on a resource from start to finish and the nextLink will be followed to the end as stated at Use delta query to track changes in Microsoft Graph data - Microsoft Graph | Microsoft Learn.

However, today there is no way to access the deltaLink, that's returned on the last page to track changes from "last delta call".

I want to be able to access the deltaLink as well as passing it to the delta command, so I can track the changes from the last call.

Activity

  1. maisarissi commented on Jun 2, 2023

    @maisarissi
    Author

    Peter Ombwa (@peombwa) Tim (@timayabi2020) can you validate whether AutoREST supports it?

  2. peombwa commented on Jun 2, 2023

    @peombwa
    Member

    The CSDL will also need to be annotated to signal to SDKs that delta functions support deltaToken query parameter - microsoftgraph/msgraph-metadata#354.

  3. peombwa commented on Jul 20, 2023

    @peombwa
    Member

    Per the discussion at microsoftgraph/msgraph-metadata#354 (comment), the SDK should instead add support -DeltaLink parameter, which takes the @odata.deltalink value from the previous call:

    Get-Mg*Delta -DeltaLink $link # value from the odata.deltalink property of the previous call

    The implementation should ensure:

    • @odata.deltalink property from the previous request is available to the caller. This can be a global variable, etc.
    • Get-Mg*Delta -DeltaLink parameter set should only support -DeltaLink parameter to avoid sending malformed request URIs. Query parameters are specified once in the initial request. Microsoft Graph automatically encodes the specified parameter into the @odata.deltaLink returned in the response.
  4. added this to the v3 milestone on Jul 20, 2023
  5. pgarm commented on Aug 30, 2023

    @pgarm

    Hey folks, just adding my 2c - been talking over this with Steve Mutungi (@SteveMutungi254) since May and then it got kinda forgotten for a while, as I mistakenly popped the bug in ADO and not here :)
    Got a bit of flak from customers on this as they were building automation around the delta functionality. Given them this sample as a workaround, but certainly seems an overlooked capability ;)

    Carol Kigoonya (@CarolKigoonya)

  6. pgarm commented on Aug 30, 2023

    @pgarm

    Copying from ADO

    Solution options

    1. Implement session/module variable to cache deltaLink, and implicitly use it on subsequent Get-MgXxxxDelta executions.
      Downside - only persistent within session, so not suitable for scheduled jobs (based on customer conversations, this is mostly used in non-interactive automation).
    2. Add explicit -DeltaLinkVariable parameter to push the link into current scope so user can handle the saving/retrieval themselves, and explicit -DeltaLink parameter to use the link in subsequent calls.

    (ideally - both options to give users flexibility)
    Instead of full deltaLink, can save just the deltaToken (marginally reduces memory/storage use, but makes it harder to reuse the link elsewhere.

  7. jreinhardtproarch commented on Nov 14, 2023

    @jreinhardtproarch

    I just want to share that this is also impacting me, and is another case of the Graph SDK's lack of "fit and finish." I will attempt to use the workaround provided here, thank you, or just use Invoke-MgGraphRequest. Thanks

  8. Jakke2440 commented on Mar 20, 2024

    @Jakke2440

    any progress on this issue?

  9. timmgreen commented on Apr 26, 2024

    @timmgreen

    Hey folks, just adding my 2c - been talking over this with Steve Mutungi (@SteveMutungi254) since May and then it got kinda forgotten for a while, as I mistakenly popped the bug in ADO and not here :) Got a bit of flak from customers on this as they were building automation around the delta functionality. Given them this sample as a workaround, but certainly seems an overlooked capability ;)

    Carol Kigoonya (@CarolKigoonya)

    How do you get the removed users with this sample? In my case it returns 380 users. The actual membership is 376 with 4 removed (1 object was deleted)

    Using Get-MgGroupDelta objects that have been removed have an @removed key
    @odata.type
    id
    @removed

    I don't see that when using the workaround sample. When using Invoke-MgGraphRequest and setting OutputType to PSObject that key is not included.

    $groupDelta.value.'members@delta' | Get-member | select name

    Name
    Equals
    GetHashCode
    GetType
    ToString
    @odata.type
    id

  10. MartinM85 commented on Jul 8, 2024

    @MartinM85

    any ETA on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions