An API that connects multiple Microsoft services, enabling data access and automation across platforms
MSGraph partner events, only return changed values
Alistair Young
56
Reputation points
I'm receiving user upated events from Entra via an MSGraph partner topic but it always returns all attributes from a call to GetAsDeltaGetResponseAsync, regardless of whether they have change or not.
var userChanges = await graphServiceClient.Users.Delta.GetAsDeltaGetResponseAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = $"id eq ('{cloudData.ResourceData!.Id}')";
requestConfiguration.Headers.Add("ConsistencyLevel", "eventual");
requestConfiguration.Headers.Add("Prefer", "return=minimal");
requestConfiguration.QueryParameters.Count = true;
requestConfiguration.QueryParameters.Select = ["id,userPrincipalName,givenName,surname,displayName,mail,mailNickname,employeeId,employeeType,jobTitle,mobilePhone,officeLocation,postalCode,onPremisesSamAccountName,onPremisesUserPrincipalName,ageGroup,businessPhones,proxyAddresses,onPremisesExtensionAttributes"];
});
the return=minimal header doesn't seem to do anything and all attributes are returned fully populated even if they weren't updated in Entra. Is there a way to do a query from a notification event handler to only get the changed attributes?
In the response I see this:
"BackingStore":
{
"InitializationCompleted":false,
"ReturnOnlyChangedValues":false
},
I only want the values of the changed attributes.
Microsoft Security | Microsoft Graph
Microsoft Security | Microsoft Graph
Sign in to answer