estoy intentando crear una base de datos con un programa escrito en c#. Me he creado una cuenta gratuita y he creado un recurso de azure cosmos db. La conexión con la cuenta de cosmos db se realiza correctamente pero a la hora de crear la base de datos no obtengo respuesta se queda ahy esperando. Es posible que necesite una subscripción mayor para poder hacer esto? El código es el siguiente:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using Microsoft.Azure.Documents;
using Microsoft.Azure.Documents.Client;
using Newtonsoft.Json;
namespace AzureApp
{
class Program
{
private const string EndpointUrl = "<endpoint>";
private const string PrimaryKey = "<privatekey>";
private DocumentClient client;
static void Main(string[] args)
{
try
{
Program p = new Program();
p.GetStartedDemo().Wait();
}
catch (DocumentClientException de)
{
Exception baseException = de.GetBaseException();
Console.WriteLine("{0} error occurred: {1}, Message: {2}", de.StatusCode, de.Message, baseException.Message);
}
catch (Exception e)
{
Exception baseException = e.GetBaseException();
Console.WriteLine("Error: {0}, Message: {1}", e.Message, baseException.Message);
}
finally
{
Console.WriteLine("End of demo, press any key to exit.");
Console.ReadKey();
}
}
private async Task GetStartedDemo()
{
this.client = new DocumentClient(new Uri(EndpointUrl), PrimaryKey);
await this.client.CreateDatabaseIfNotExistsAsync(new Database { Id = "FamilyDB" });
}
private void WriteToConsoleAndPromptToContinue(string format, params object[] args)
{
Console.WriteLine(format, args);
Console.WriteLine("Press any key to continue ...");
Console.ReadKey();
}
}
}
Gracias de antemano.