in code/Tools/Ops/ManageServerState/Program.cs [514:621]
private static async Task ValidateAndPrintConfiguration(string environmentName, ISettingsReaderAsync kvr)
{
if (doAll || doSearch)
{
// check that all of the required settings are not null or whitespace
if (string.IsNullOrWhiteSpace(await kvr.ReadValueAsync("SearchServiceName")))
{
Console.WriteLine("Error! SearchServiceName in your configuration is null or whitespace. Aborting...");
System.Environment.Exit(-1);
}
if (string.IsNullOrWhiteSpace(await kvr.ReadValueAsync("SearchServiceAdminKey")))
{
Console.WriteLine("Error! SearchServiceAdminKey in your configuration is null or whitespace. Aborting...");
System.Environment.Exit(-1);
}
}
if (doAll || doQueues)
{
if (string.IsNullOrWhiteSpace(await kvr.ReadValueAsync("ServiceBusConnectionString")))
{
Console.WriteLine("Error! ServiceBusConnectionString in your configuration is null or whitespace. Aborting...");
System.Environment.Exit(-1);
}
}
if (doAll || doTables)
{
if (string.IsNullOrWhiteSpace(await kvr.ReadValueAsync("AzureStorageConnectionString")))
{
Console.WriteLine("Error! AzureStorageConnectionString in your configuration is null or whitespace. Aborting...");
System.Environment.Exit(-1);
}
}
if (doAll || doBlobs || doLogs)
{
if (string.IsNullOrWhiteSpace(await kvr.ReadValueAsync("AzureBlobStorageConnectionString")))
{
Console.WriteLine("Error! AzureBlobStorageConnectionString in your configuration is null or whitespace. Aborting...");
System.Environment.Exit(-1);
}
}
if (doAll || doRedis)
{
if (string.IsNullOrWhiteSpace(await kvr.ReadValueAsync("VolatileRedisConnectionString")))
{
Console.WriteLine("Error! VolatileRedisConnectionString in your configuration is null or whitespace. Aborting...");
System.Environment.Exit(-1);
}
if (string.IsNullOrWhiteSpace(await kvr.ReadValueAsync("PersistentRedisConnectionString")))
{
Console.WriteLine("Error! PersistentRedisConnectionString in your configuration is null or whitespace. Aborting...");
System.Environment.Exit(-1);
}
}
// for clean operations, make sure we are not operating on a production service
if (doClean && (ProdConfiguration.IsProduction(await kvr.ReadValueAsync("SearchServiceName")) ||
ProdConfiguration.IsProduction(await kvr.ReadValueAsync("ServiceBusConnectionString")) ||
ProdConfiguration.IsProduction(await kvr.ReadValueAsync("AzureStorageConnectionString")) ||
ProdConfiguration.IsProduction(await kvr.ReadValueAsync("AzureBlobStorageConnectionString")) ||
ProdConfiguration.IsProduction(await kvr.ReadValueAsync("VolatileRedisConnectionString")) ||
ProdConfiguration.IsProduction(await kvr.ReadValueAsync("PersistentRedisConnectionString"))))
{
Console.WriteLine("Error! Your configuration includes a production service. Aborting...");
System.Environment.Exit(-1);
}
Console.WriteLine();
Console.Write("Environment name: ");
Console.WriteLine(environmentName);
Console.WriteLine();
Console.WriteLine("Current configuration:");
if (doAll || doSearch)
{
Console.WriteLine("\tsearch service name: " + await kvr.ReadValueAsync("SearchServiceName"));
Console.WriteLine("\tsearch admin key: " + await kvr.ReadValueAsync("SearchServiceAdminKey"));
}
if (doAll || doQueues)
{
Console.WriteLine("\tservice bus connection string: " + await kvr.ReadValueAsync("ServiceBusConnectionString"));
}
if (doAll || doTables)
{
Console.WriteLine("\tazure table storage string: " + await kvr.ReadValueAsync("AzureStorageConnectionString"));
}
if (doAll || doBlobs || doLogs)
{
Console.WriteLine("\tazure blob storage string: " + await kvr.ReadValueAsync("AzureBlobStorageConnectionString"));
}
if (doAll || doRedis)
{
Console.WriteLine("\tredis connection strings: ");
Console.WriteLine("\t Volatile = {0}", await kvr.ReadValueAsync("VolatileRedisConnectionString"));
Console.WriteLine("\t Persistent = {0}", await kvr.ReadValueAsync("PersistentRedisConnectionString"));
}
Console.WriteLine();
Console.WriteLine();
}