Azure Media Services v3 - c# Odata Query fails with 400 Bad Request for properties.created gt date works for REST api.
Working REST Version
GET https://management.azure.com/subscriptions/1234/resourceGroups/ResGroup/providers/Microsoft.Media/mediaServices/testurstream/assets?api-version=2018-07-01&$filter=properties/created gt 2018-06-01 and properties/created lt 2019-07-01
Broken .NET Version (Fiddler trace)
GET https://management.azure.com/subscriptions/1234/resourceGroups/ResGroup/providers/Microsoft.Media/mediaServices/testurstream/assets?$filter=properties/created%20gt%20'2018-11-11T10%3A48%3A37Z'&api-version=2018-07-01
Docs state greater than is supported for created.
properties.created Supports: Eq, Gt, Lt Supports: Ascending and Descending
Code Sample:
var query = new ODataQuery<Asset>(item => item.Created > lastFetchTime);
var assets = _client.Assets.List(ResourceGroup, AccountName, query);
Exception:
Microsoft.Azure.Management.Media.Models.ApiErrorException
HResult=0x80131500
Message=Operation returned an invalid status code 'BadRequest'
Source=Microsoft.Azure.Management.Media
StackTrace:
at Microsoft.Azure.Management.Media.AssetsOperations.<ListWithHttpMessagesAsync>d__5.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Management.Media.AssetsOperationsExtensions.<ListAsync>d__1.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Management.Media.AssetsOperationsExtensions.List(IAssetsOperations operations, String resourceGroupName, String accountName, ODataQuery`1 odataQuery)
Fiddler Result
# Result Protocol Host URL Body Caching Content-Type Process Comments Custom
13 400 HTTPS management.azure.com /subscriptions/1234/resourceGroups/ResGroup/providers/Microsoft.Media/mediaServices/testurstream/assets?$filter=properties/created%20gt%20'2018-11-11T00%3A00%3A00Z'&api-version=2018-07-01 217 private application/json; charset=utf-8 amstestv3:7148