Created
March 6, 2018 23:26
-
-
Save dstarr/f91e7a919f78ae1ad5c33e9ce86686f7 to your computer and use it in GitHub Desktop.
Provision Azure Cosmos DB if needed
This file contains 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
private async Task ProvisionDbIfNeeded() | |
{ | |
await client.CreateDatabaseIfNotExistsAsync(new Database { Id = dbName }); | |
await client.CreateDocumentCollectionIfNotExistsAsync( | |
UriFactory.CreateDatabaseUri(dbName), | |
new DocumentCollection { Id = collectionName } | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment