private static void StartHost(string consumerGroupPrefix) { Trace.WriteLine("Starting Worker..."); #if DEBUG_LOG RoleEnvironment.TraceSource.TraceInformation("Starting Worker..."); #endif var config = new Configuration(); config.AlertEHConnectionString = ConfigurationManager.AppSettings.Get("Microsoft.ServiceBus.ConnectionStringAlerts"); config.AlertEHName = ConfigurationManager.AppSettings.Get("Microsoft.ServiceBus.EventHubAlerts"); config.DeviceEHConnectionString = ConfigurationManager.AppSettings.Get("Microsoft.ServiceBus.ConnectionStringDevices"); config.DeviceEHName = ConfigurationManager.AppSettings.Get("Microsoft.ServiceBus.EventHubDevices");; config.AnomalyDetectionApiUrl = ConfigurationManager.AppSettings.Get("AnomalyDetectionApiUrl"); config.AnomalyDetectionAuthKey = ConfigurationManager.AppSettings.Get("AnomalyDetectionAuthKey"); config.LiveId = ConfigurationManager.AppSettings.Get("LiveId"); config.MeasureNameFilter = ConfigurationManager.AppSettings.Get("MeasureNameFilter"); config.TukeyThresh = ConfigurationManager.AppSettings.Get("TukeyThresh"); config.ZscoreThresh = ConfigurationManager.AppSettings.Get("ZscoreThresh"); bool.TryParse(ConfigurationManager.AppSettings.Get("UseMarketApi"), out config.UseMarketApi); int.TryParse(ConfigurationManager.AppSettings.Get("MessagesBufferSize"), out config.MessagesBufferSize); int.TryParse(ConfigurationManager.AppSettings.Get("AlertsIntervalSec"), out config.AlertsIntervalSec); config.StorageConnectionString = ConfigurationManager.AppSettings.Get("Microsoft.Storage.ConnectionString"); config.BlobContainerName = ConfigurationManager.AppSettings.Get("blobContainerName"); config.BlobNamePrefix = ConfigurationManager.AppSettings.Get("blobNamePrefix"); config.SqlDatabaseConnectionString = ConfigurationManager.AppSettings.Get("sqlDatabaseConnectionString"); _analyzer = new Analyzer(config.AnomalyDetectionApiUrl, config.AnomalyDetectionAuthKey, config.LiveId, config.UseMarketApi, config.TukeyThresh, config.ZscoreThresh); _eventHubReader = new EventHubReader(config.MessagesBufferSize, consumerGroupPrefix); if (ConfigurationManager.AppSettings.Get("sendToBlob") == "true") { _blobWriter = new BlobWriter(); if (_blobWriter.Connect(config.BlobNamePrefix, config.BlobContainerName, config.StorageConnectionString)) { _blobWriter = null; } } if (ConfigurationManager.AppSettings.Get("sendToSQL") == "true") { _sqlOutputRepository = new SQLOutputRepository(config.SqlDatabaseConnectionString); } Process(config); }