Reza Amya
Reza Amya

Reputation: 1724

How to get sorted results in powershell using az storage entity query?

When you are using Azure Storage Explorer you can click on the name of each columns to sort the results by that field. In Microsoft Azure Storage Explorer you can sort results Is there any way to sort query results in PowerShell using az storage entity query? In another word, I can get the results in Azure CLI as an object and I can sort it using Sort-Object, but I want to sort entries on the Azure Storage Server and get sorted-results. It's not useful to get all of the data from the server and sort it manually.

Upvotes: 0

Views: 1135

Answers (2)

kim
kim

Reputation: 3421

Please see this page https://learn.microsoft.com/en-us/rest/api/storageservices/Query-Operators-Supported-for-the-Table-Service?redirectedfrom=MSDN.

There's a complete list of supported operators you can use with Azure Storage Table, OrderBy is sadly not among the supported ones.

This means, you will need to retrieve the data first, then do the sorting.

Upvotes: 1

Gaurav Mantri
Gaurav Mantri

Reputation: 136336

but I want to sort entries on the Azure Storage Server and get sorted-results. It's not useful to get all of the data from the server and sort it manually.

It is not possible as Azure Tables does not support server-side sorting. You will need to fetch the desired data on the client and perform the sorting there only.

Upvotes: 1

Related Questions