title: Azure Cloud Table Storage
body: <p><strong>Summary</strong></p>
  
  <ul>
  <li>I'm trying to learn how to read and write to Azure Cloud Table Storage.</li>
  <li>I've read a number of tutorials, and have some questions.</li>
  <li>In the following simple code example, we access a storage account, get a reference to an existing table, insert a record, and then read the record back from the table, noting that it now exists within the cloud storage table.</li>
  </ul>
  
  <p><strong>Simple Code Example</strong></p>
  
  <pre><code>static void Main(string[] args)
  {
    try
    {
       CloudStorageAccount storageAccount =
          CloudStorageAccount.Parse("DefaultEndpointsProtocol=https;AccountName=&lt;your_storage_name&gt;;AccountKey=&lt;your_account_key&gt;");
       CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
  
       CloudTable table = tableClient.GetTableReference("people");
       table.CreateIfNotExists();
  
       CustomerEntity customer1 = new CustomerEntity("Harp", "Walter");
       customer1.Email = "Walter@contoso.com";
       customer1.PhoneNumber = "425-555-0101";
  
       // Create the TableOperation that inserts the customer entity.
       var insertOperation = TableOperation.Insert(customer1);
  
       // Execute the insert operation.
       table.Execute(insertOperation);
  
       // Read storage
       TableQuery&lt;CustomerEntity&gt; query =
          new TableQuery&lt;CustomerEntity&gt;()
             .Where(TableQuery.GenerateFilterCondition("PartitionKey",
                 QueryComparisons.Equal, "Harp"));
       var list = table.ExecuteQuery(query).ToList();
     }
     catch (StorageException ex)
     {
         // Exception handling here.
     }
  }
  
  public class CustomerEntity : TableEntity
  {
      public string Email { get; set; }
      public string PhoneNumber { get; set; }
  
      public CustomerEntity(string lastName, string firstName)
      {
          PartitionKey = lastName;
          RowKey = firstName;
      }
  
      public CustomerEntity() { }
  }
  </code></pre>
  
  <p><strong>Questions</strong></p>
  
  <ol>
  <li>Is a table the same as a blob or a container? </li>
  <li>If I wanted to setup my "people" table on my Azure Cloud Storage Account, before actually performing any code operations, do I just create a new storage account, and then create a container or a blob? I can't see any option to create a "table" on the Azure management website?</li>
  <li>Once the table exists, do I have to create columns to represent the properties of my entity object that I'm trying to store within the table? Or does the table simply automatically take its structure from the structure of my entity object and its properties?</li>
  </ol>