I am getting a JSON parsing error only in one Azure tenant. I've tested the same code in 3 other tenants.
Calling code:
activeDirectoryClient.Users.Where(x=>x.LastDirSyncTime >= lastSyncDateOnly).ExecuteAsync();
Error that occurs during paging through results:
pagedCollection = await pagedCollection.GetNextPageAsync();
Invalid JSON. A colon character ':' is expected after the property name 'usageLocation', but none was found. ---> Microsoft.Data.OData.ODataException: Invalid JSON. A colon character ':' is expected after the property name 'usageLocation', but none was found.
System.InvalidOperationException: Invalid JSON. A colon character ':' is expected after the property name 'usageLocation', but none was found. ---> Microsoft.Data.OData.ODataException: Invalid JSON. A colon character ':' is expected after the property name 'usageLocation', but none was found.
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.Json.JsonReader.ParseProperty()
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.Json.JsonReader.Read()
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.Json.BufferingJsonReader.ReadInternal()
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.Json.BufferingJsonReader.ReadNextAndCheckForInStreamError()
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.Json.BufferingJsonReader.ReadInternal()
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.Json.BufferingJsonReader.Read()
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.Json.ODataJsonReaderCoreUtils.TryReadNullValue(BufferingJsonReader jsonReader, ODataInputContext inputContext, IEdmTypeReference expectedTypeReference, Boolean validateNullValue, String propertyName)
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.JsonLight.ODataJsonLightPropertyAndValueDeserializer.ReadNonEntityValueImplementation(String payloadTypeName, IEdmTypeReference expectedTypeReference, DuplicatePropertyNamesChecker duplicatePropertyNamesChecker, CollectionWithoutExpectedTypeValidator collectionValidator, Boolean validateNullValue, Boolean isTopLevelPropertyValue, Boolean insideComplexValue, String propertyName, Boolean readRawValueEvenIfNoTypeFound)
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.JsonLight.ODataJsonLightEntryAndFeedDeserializer.ReadEntryDataProperty(IODataJsonLightReaderEntryState entryState, IEdmProperty edmProperty, String propertyTypeName)
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.JsonLight.ODataJsonLightEntryAndFeedDeserializer.ReadEntryPropertyWithValue(IODataJsonLightReaderEntryState entryState, String propertyName)
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.JsonLight.ODataJsonLightEntryAndFeedDeserializer.<>c__DisplayClass2.b__0(PropertyParsingResult propertyParsingResult, String propertyName)
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.JsonLight.ODataJsonLightDeserializer.ProcessProperty(DuplicatePropertyNamesChecker duplicatePropertyNamesChecker, Func2 readPropertyAnnotationValue, Action
2 handleProperty)
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.JsonLight.ODataJsonLightEntryAndFeedDeserializer.ReadEntryContent(IODataJsonLightReaderEntryState entryState)
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.JsonLight.ODataJsonLightReader.ReadEntryStart(DuplicatePropertyNamesChecker duplicatePropertyNamesChecker, SelectedPropertiesNode selectedProperties)
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.JsonLight.ODataJsonLightReader.ReadAtEntryEndImplementationSynchronously()
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.JsonLight.ODataJsonLightReader.ReadAtEntryEndImplementation()
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.ODataReaderCore.ReadImplementation()
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.ODataReaderCore.ReadSynchronously()
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.ODataReaderCore.InterceptException[T](Func1 action) [06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Data.OData.ODataReaderCore.Read() [06/30/2016 12:30:47 > 573298: INFO] at System.Data.Services.Client.Materialization.ODataReaderWrapper.Read() [06/30/2016 12:30:47 > 573298: INFO] at System.Data.Services.Client.Materialization.FeedAndEntryMaterializerAdapter.TryRead() [06/30/2016 12:30:47 > 573298: INFO] --- End of inner exception stack trace --- [06/30/2016 12:30:47 > 573298: INFO] at System.Data.Services.Client.Materialization.FeedAndEntryMaterializerAdapter.TryRead() [06/30/2016 12:30:47 > 573298: INFO] at System.Data.Services.Client.Materialization.FeedAndEntryMaterializerAdapter.TryStartReadFeedOrEntry() [06/30/2016 12:30:47 > 573298: INFO] at System.Data.Services.Client.Materialization.FeedAndEntryMaterializerAdapter.TryReadEntry(MaterializerEntry& entry) [06/30/2016 12:30:47 > 573298: INFO] at System.Data.Services.Client.Materialization.FeedAndEntryMaterializerAdapter.<LazyReadEntries>d__0.MoveNext() [06/30/2016 12:30:47 > 573298: INFO] at System.Data.Services.Client.Materialization.FeedAndEntryMaterializerAdapter.Read() [06/30/2016 12:30:47 > 573298: INFO] at System.Data.Services.Client.Materialization.ODataReaderEntityMaterializer.ReadNextFeedOrEntry() [06/30/2016 12:30:47 > 573298: INFO] at System.Data.Services.Client.Materialization.ODataEntityMaterializer.ReadImplementation() [06/30/2016 12:30:47 > 573298: INFO] at System.Data.Services.Client.MaterializeAtom.MoveNextInternal() [06/30/2016 12:30:47 > 573298: INFO] at System.Data.Services.Client.MaterializeAtom.MoveNext() [06/30/2016 12:30:47 > 573298: INFO] at System.Linq.Enumerable.<CastIterator>d__94
1.MoveNext()
[06/30/2016 12:30:47 > 573298: INFO] at System.Collections.Generic.List1..ctor(IEnumerable
1 collection)
[06/30/2016 12:30:47 > 573298: INFO] at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) [06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Azure.ActiveDirectory.GraphClient.Extensions.PagedCollection
2..ctor(DataServiceContextWrapper context, QueryOperationResponse1 qor) [06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Azure.ActiveDirectory.GraphClient.Extensions.PagedCollection
2.d__0.MoveNext()
[06/30/2016 12:30:47 > 573298: INFO] --- End of inner exception stack trace ---
[06/30/2016 12:30:47 > 573298: INFO] at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
[06/30/2016 12:30:47 > 573298: INFO] at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
[06/30/2016 12:30:47 > 573298: INFO] at Microsoft.Azure.ActiveDirectory.GraphClient.Extensions.TranslatingPagedCollection2.<GetNextPageAsync>b__0() [06/30/2016 12:30:47 > 573298: INFO] at System.Threading.Tasks.Task
1.InnerInvoke()
[06/30/2016 12:30:47 > 573298: INFO] at System.Threading.Tasks.Task.Execute()
[06/30/2016 12:30:47 > 573298: INFO] --- End of stack trace from previous location where exception was thrown ---
[06/30/2016 12:30:47 > 573298: INFO] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[06/30/2016 12:30:47 > 573298: INFO] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[06/30/2016 12:30:47 > 573298: INFO] at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
[06/30/2016 12:30:47 > 573298: INFO] at Core.UserProfiles.Sync.Repositories.AzureAdRepository.d__0.MoveNext() in