Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Example value: Central US,West US,UK West. This can be found in the overview blade of you Azure Cosmos DB Gremlin Account.
- // Look for Write Locations in the overview blade. You can click to copy and paste.
- string[] regions = new string[] {"Central US", "West US" ,"UK West"};
- string gremlinEndpoint = "FILL_ME.gremlin.cosmosdb.azure.com";
- foreach (string region in regions)
- {
- // convert preferred read location to the form "[acountName]-[region].gremlin.cosmosdb.azure.com"
- string regionalGremlinEndpint = gremlinEndpoint.Replace(".gremlin.cosmosdb.azure.com", $"-{region.ToLower().Replace(" ", string.Empty)}.gremlin.cosmosdb.azure.com");
- var regionalGremlinServer = new GremlinServer(
- regionalGremlinEndpint,
- gremlinServerPort,
- enableSsl: true,
- username: "/dbs/" + database + "/colls/" + lwwCollectionName,
- password: accountKey);
- var regionalGremlinClient = new GremlinClient(regionalGremlinServer, new GraphSON2Reader(), new GraphSON2Writer(), GremlinClient.GraphSON2MimeType);
- }
Add Comment
Please, Sign In to add comment