This commit is contained in:
Matias Quaranta 2019-06-07 06:36:01 -07:00 коммит произвёл kirankumarkolli
Родитель 427a8994af
Коммит ca0b972cf1
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -13,6 +13,7 @@ namespace Cosmos.Samples.AzureFunctions
private static IConfigurationRoot configuration = new ConfigurationBuilder()
.SetBasePath(Environment.CurrentDirectory)
.AddJsonFile("AppSettings.json", optional: true, reloadOnChange: true)
.AddEnvironmentVariables()
.Build();
public override void Configure(IFunctionsHostBuilder builder)
@ -23,13 +24,13 @@ namespace Cosmos.Samples.AzureFunctions
string endpoint = configuration["EndPointUrl"];
if (string.IsNullOrEmpty(endpoint))
{
throw new ArgumentNullException("Please specify a valid endpoint in the appSettings.json");
throw new ArgumentNullException("Please specify a valid endpoint in the appSettings.json file or your Azure Functions Settings.");
}
string authKey = configuration["AuthorizationKey"];
if (string.IsNullOrEmpty(authKey) || string.Equals(authKey, "Super secret key"))
{
throw new ArgumentException("Please specify a valid AuthorizationKey in the appSettings.json");
throw new ArgumentException("Please specify a valid AuthorizationKey in the appSettings.json file or your Azure Functions Settings.");
}
CosmosClientBuilder configurationBuilder = new CosmosClientBuilder(endpoint, authKey);