title: Creating a table in Azure Table fails without exception
body: <p>I'm trying to create a table in Windows Azure Table service, using the example <a href="https://github.com/Azure-Samples/storage-table-dotnet-getting-started" rel="nofollow noreferrer">https://github.com/Azure-Samples/storage-table-dotnet-getting-started</a></p>
  
  <p>While running this example, I have no problem : the table creates itself, insert and delete work fine.</p>
  
  <p>But what I copied as code into my project can't seem to work properly. Table creation apparently fails but returns no exception whatsoever. It's like my code does not wait for the table creation to finish.</p>
  
  <p>Can any understand why ?</p>
  
  <p>Thanks for your help !</p>
  
  <p>Here is how I call the code :</p>
  
  <pre><code>public async void saveInAzureTable()
  {
              AzureStorage azure = new AzureStorage();
              CloudTable table = await     AzureStorage.CreateTableAsync("randomtable123");
  }
  </code></pre>
  
  <p>And here's the AzureStorage class :</p>
  
  <pre><code>    using System;
      using System.Threading.Tasks;
      using Microsoft.Azure;
      using Microsoft.WindowsAzure.Storage;
      using Microsoft.Wi`enter code here`ndowsAzure.Storage.Table;
      using Scraper.Models;
  
      namespace Scraper
      {
          public class AzureStorage
          {
              public async Task&lt;TableResult&gt; storeAdvertisementInAzure(CloudTable table, AdvertisementEntity entity)
          {
              TableOperation insertOrMergeOperation = TableOperation.InsertOrMerge(entity);
              TableResult result = await table.ExecuteAsync(insertOrMergeOperation);
              return result;
          }
  
          /// &lt;summary&gt;
          /// Validate the connection string information in app.config and throws an exception if it looks like 
          /// the user hasn't updated this to valid values. 
          /// &lt;/summary&gt;
          /// &lt;param name="storageConnectionString"&gt;Connection string for the storage service or the emulator&lt;/param&gt;
          /// &lt;returns&gt;CloudStorageAccount object&lt;/returns&gt;
          public static CloudStorageAccount CreateStorageAccountFromConnectionString(string storageConnectionString)
          {
              CloudStorageAccount storageAccount;
              try
              {
                  storageAccount = CloudStorageAccount.Parse(storageConnectionString);
              }
              catch (FormatException)
              {
                  Console.WriteLine("Invalid storage account information provided. Please confirm the AccountName and AccountKey are valid in the app.config file - then restart the application.");
                  throw;
              }
              catch (ArgumentException)
              {
                  Console.WriteLine("Invalid storage account information provided. Please confirm the AccountName and AccountKey are valid in the app.config file - then restart the sample.");
                  Console.ReadLine();
                  throw;
              }
  
              return storageAccount;
          }
  
  
          /// &lt;summary&gt;
          /// Create a table for the sample application to process messages in. 
          /// &lt;/summary&gt;
          /// &lt;returns&gt;A CloudTable object&lt;/returns&gt;
          public static async Task&lt;CloudTable&gt; CreateTableAsync(string tableName)
          {
              // Retrieve storage account information from connection string.
              CloudStorageAccount storageAccount = CreateStorageAccountFromConnectionString(CloudConfigurationManager.GetSetting("StorageConnectionString"));
  
              // Create a table client for interacting with the table service
              CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
  
              Console.WriteLine("Create a Table to store data from the scraper");
  
              // Create a table client for interacting with the table service 
              CloudTable table = tableClient.GetTableReference(tableName);
              try
              {
                  if (await table.CreateIfNotExistsAsync())
                  {
                      Console.WriteLine("Created Table named: {0}", tableName);
                  }
                  else
                  {
                      Console.WriteLine("Table {0} already exists", tableName);
                  }
              }
              catch (StorageException)
              {
                  Console.WriteLine("If you are running with the default configuration please make sure you have started the storage emulator. Press the Windows key and type Azure Storage to select and run it from the list of applications - then restart the sample.");
                  Console.ReadLine();
                  throw;
              }
  
              Console.WriteLine();
              return table;
          }
  
      }
  }
  </code></pre>