0

This has been a mess for a big while with .NET Core 2!

I need A VERY simple thing - I need to use Table Storage in my .NET Core 2.2 app using Microsoft.Azure.CosmosDB.Table package. ok, let's do this, shall we?

First things first, let's create CloudTableClient:

using Microsoft.Azure.CosmosDB.Table;
using Microsoft.Azure.Storage.Common;

…

CloudTableClient tableClient = new CloudTableClient(
  new Uri("[WHAT TO PUT IN HERE in case of Azure and Emulator???]"),
  new Microsoft.Azure.Storage.Auth.StorageCredentials() // => **THIS DOES NOT EVEN COMPILE! Auth is not a part of the package **
);

NICE! Where do we go from here? Please don't point me to examples - they're not for .NET Core 2.2!

And let's not mix Microsoft.Azure.Storage and Microsoft.WindowsAzure.Storage packages!

When is this going to be fixed? How to create CloudTableClient and use the CloudTable?

12
  • 5
    Is this a rant or a question? Commented Mar 9, 2019 at 10:58
  • The documentation for StorageCredentials seems to be pretty reasonable, for the second argument to the CloudTableClient constructor. Commented Mar 9, 2019 at 11:00
  • Have you tried mixing Microsoft.Azure.Storage AND Microsoft.WindowsAzure.Storage packages in .NET Core 2.2??? Commented Mar 9, 2019 at 11:01
  • Ah, so it's a different StorageCredentials class. Okay. If you could edit the question to make the different types clearer, along with what you've tried to construct a StorageCredentials object (and precisely which NuGet package you're using) you might find people are better able to help you. While I can understand wanting to let off steam, just ranting is not the best way of getting help. Commented Mar 9, 2019 at 11:05
  • 1
    Also worth pointing out that Microsoft.Azure.Cosmos.Table is still in preview so expect it to be buggy and don't go using it in production projects. I'm afraid you'll just have to be patient, maybe go on Microsoft Azure Cosmos DB .NET SDK github open a new issue and rant about it there. Commented Mar 9, 2019 at 11:26

2 Answers 2

1

This works perfectly fine:

var tableName = "TestTempTable";
var storageConnectionString = "DefaultEndpointsProtocol=https;AccountName=....;AccountKey=....;EndpointSuffix=core.windows.net";
var storageAccount = CloudStorageAccount.Parse(storageConnectionString);
var tableClient = storageAccount.CreateCloudTableClient(new TableClientConfiguration());
var table = tableClient.GetTableReference(tableName);
await table.CreateIfNotExistsAsync();
Sign up to request clarification or add additional context in comments.

Comments

0

I have to conclude that there is no way of working with Azure Tables in .NET Core 2.x projects. Downgrading to some old packages or preview versions is not an option.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.