Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Azure Tables Storage Query returns 501 (Not Implemented)

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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?

>Solution :

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'");
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading