Connect to an account (.NET)
- To connect to your DocumentDB database you will need to create a DocumentClient with your Endpoint URI and the Service Key (you can get both from the portal).
- First of all, you will need the following using clauses:
using System;
using Microsoft.Azure.Documents.Client;
click below button to copy the code. By azure tutorial team
- Then you can create the client with:
var endpointUri = "<your endpoint URI>";
var primaryKey = "<your key>";
var client = new DocumentClient(new Uri(endpointUri), primaryKey);