I have a problem with an API to access a collection DocumentDB. If I run the API from my development environment (Visual Studio) it works well and returns all JSON documents in the collections. The latency time is about 1 minute. But when the API is deployed in Azure, it don not return anything. I have not yet implemented Application Insight in the API.
The C# code for the API is:
string DatabaseId = ConfigurationManager.AppSettings["database"];
string CollectionId = ConfigurationManager.AppSettings["collectionExperimentos"];
DocumentClient client = new DocumentClient(new Uri(ConfigurationManager.AppSettings["endpoint"]), ConfigurationManager.AppSettings["authKey"],
new ConnectionPolicy
{
ConnectionMode = ConnectionMode.Direct,
ConnectionProtocol = Protocol.Tcp
});
var collectionLink = UriFactory.CreateDocumentCollectionUri(DatabaseId, CollectionId);
List<Experiment> experimentosList = new List<Experiment>();
experimentosList = client.CreateDocumentQuery<Experiment>(collectionLink).ToList();
experimentosList = experimentosList.OrderByDescending(experimentos => DateTime.Parse(experimentos.dateCreated)).ToList();
The collection size is 160MB and has no partitions.