Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Microsoft Azure Storage Essentials

You're reading from   Microsoft Azure Storage Essentials Harness the power of Microsoft Azure services to build efficient cloud solutions

Arrow left icon
Product type Paperback
Published in Aug 2015
Publisher
ISBN-13 9781784396237
Length 126 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Chukri A Soueidi Chukri A Soueidi
Author Profile Icon Chukri A Soueidi
Chukri A Soueidi
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. An Introduction to Microsoft Azure Storage Services 2. Developing Against Storage FREE CHAPTER 3. Working with Blobs 4. Working with Tables 5. Designing Scalable and Performant Tables 6. Working with Queues 7. Working with the Azure File Service 8. Transient Fault Handling and Analytics Index

Starting with a table


Using the connection string defined in the App.config file, we will proceed to create a CloudStorageAccount object which represents the storage account where the tables will be created. After that we need to use the CloudTableClient class, which is defined under the Microsoft.WindowsAzure.Storage.Table namespace, to create an object which represents a frontage for dealing with Table storage specifically and directly.

After creating the table object we will call its CreateIfNotExists() method that will actually call the Table REST API to create a table. The method is idempotent: if the table already exists, the method will do nothing no matter how many times you call it.

The following is the code to do create a table:

string connectionString = ConfigurationManager.AppSettings["StorageConnectionString"];
    CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString);

    CloudTableClient tableClient = storageAccount.CreateCloudTableClient();

    CloudTable...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image