Azure Table Storage In ASP.NET Core 2.0

Add a class to encapsulate storage access. Add a private helper method to access storage

Problem

How to use Azure Table storage in ASP.NET Core.

Solution

Create a class library and add NuGet package: WindowsAzure.Storage

Add a class to encapsulate the settings.

Add a class to encapsulate the storage access. Add a private helper method to access the storage.

Now, add public methods for the storage.

Inject and use storage

In ASP.NET Core Web application, configure services.

Discussion

The sample code will require you to setup Azure account, storage account, and table. Instructions for these could be found here.

Source Code

GitHub