Skip to content

Instantly share code, notes, and snippets.

@BanksySan
Created April 4, 2019 12:52
Show Gist options
  • Save BanksySan/aff156b63b2e513f007194ebed8b69cc to your computer and use it in GitHub Desktop.
Save BanksySan/aff156b63b2e513f007194ebed8b69cc to your computer and use it in GitHub Desktop.
CosmosDB hanging on table creation.
using Microsoft.Azure.Cosmos.Table;
using System.Diagnostics;
using System.Threading.Tasks;
namespace Framework
{
class Program
{
static async Task Main(string[] args)
{
var table = await GetCloudTable();
}
public static async Task<CloudTable> GetCloudTable()
{
var connectionString = "DefaultEndpointsProtocol=https;AccountName=pandorasbox;AccountKey=Xo5Ga1YlUj7TzN08NwLrdGPReC35wxq1aJcuVu1eLECwGUFqEnQ9UDCxzE8mNQtOKbsSbuxcXXZbyge0xqym1A==;TableEndpoint=https://pandorasbox.table.cosmos.azure.com:443/;";
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString);
var tableClient = storageAccount.CreateCloudTableClient();
var table = tableClient.GetTableReference("test");
await table.CreateIfNotExistsAsync();
return table;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment