Created
April 4, 2019 12:52
-
-
Save BanksySan/aff156b63b2e513f007194ebed8b69cc to your computer and use it in GitHub Desktop.
CosmosDB hanging on table creation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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