What are the alternatives to list all tables in Azure Storage Account since Microsoft.WindowsAzure.Storage is now depecrated

FlyingInCloud 21 Reputation points
2023-01-18T15:34:21.7033333+00:00

Using Microsoft.WindowsAzure.Storage we can list all tables in a Storage Account easily like this:

    string storageConnectionString = Environment.GetEnvironmentVariable("StorageConnectionString");
    CloudStorageAccount storageAccount = CloudStorageAccount.Parse(storageConnectionString);
    CloudTableClient tableClient = storageAccount.CreateCloudTableClient();

    List
Azure Table Storage
Azure Table Storage
An Azure service that stores structured NoSQL data in the cloud.
170 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,149 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 54,316 Reputation points
    2023-01-18T16:26:56.8966667+00:00

    I don't use ATS but I believe the equivalent code is available in [TableServiceClient.Query](https://video2.skills-academy.com/en-us/dotnet/api/azure.data.tables.tableserviceclient.query?view=azure-dotnet which is defined in the Azure.Data.Tables package of the Azure SDK for .NET library. It supposedly handles Cosmos and Storage Account tables.

    0 comments No comments

  2. Sumarigo-MSFT 46,126 Reputation points Microsoft Employee
    2023-01-21T05:54:23.4233333+00:00

    @FlyingInCloud Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    I’d use the latest SDK and leverage the following. It should provide you with the same functionality, at least based on the below?

     TableServiceClient.QueryAsyncMethod (Azure.Data.Tables) - Azure for .NET Developers | Microsoft Learn

    Please let us know if you have any further queries. I’m happy to assist you further.   


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.