I have some Data stored in Azure Data Tables and i'm using the following code to query the table:
var serviceClient = new TableServiceClient(_configuration["StorageConnectionString"]);
var tableClient = serviceClient.GetTableClient(TableName);
Pageable<EndpointEntity> queryResultsFilter = tableClient.Query<EndpointEntity>(filter: $"RowKey eq Test");
var entities = queryResultsFilter.ToList();
When ran this returns 501 Not Implemented.
RequestFailedException: The requested operation is not implemented on the specified resource.
Status: 501 (Not Implemented)
ErrorCode: NotImplemented
I tried removing the .ToList() and using foreach to iterate through instead
foreach(var x in queryResultsFilter)
{
}
But this returns the same error.
It seems like trying to do anything on the Pageable<EndpointEntity>
is causing the 501 error. My EndPointEntity Looks like this:
public class EndpointEntity : ITableEntity
{
public string PartitionKey { get; set; }
public string RowKey { get; set; }
public DateTime Timestamp { get; set; }
public DateTime PerformanceDate { get; set; }
public double TotalProcessingTimeMilliseconds { get; set; }
public string JourneyID { get; set; }
public DateTime ExpiryDate { get; set; }
public string EntityType { get; set; }
public ETag ETag { get; set; }
DateTimeOffset? ITableEntity.Timestamp { get; set; }
}
Which seems to be valid so I'm not sure why my query is returning an error?
CodePudding user response:
I think it's because of your filter expression - try enclosing the search value in your filter in single quotes:
Pageable<EndpointEntity> queryResultsFilter
= tableClient.Query<EndpointEntity>(filter: $"RowKey eq 'Test'");