Example #1
0
        public BuildsApiController()
        {
            var connectionString = CloudConfigurationManager.GetSetting(SharedConstants.StorageConnectionStringName);

            _storage   = new DashboardStorage(connectionString);
            _buildUtil = new BuildUtil(_storage.StorageAccount);
        }
Example #2
0
        public void Configuration(IAppBuilder app)
        {
            ConfigureAuth(app);

            var connectionString = CloudConfigurationManager.GetSetting(SharedConstants.StorageConnectionStringName);
            var storage          = new DashboardStorage(connectionString);

            AzureUtil.EnsureAzureResources(storage.StorageAccount);
        }
Example #3
0
        public TestDataController()
        {
            _storageAccount = ControllerUtil.CreateStorageAccount();
            var dashboardStorage = new DashboardStorage(_storageAccount);

            _storage   = new TestResultStorage(dashboardStorage);
            _stats     = new TestCacheStats(_storage);
            _statsUtil = new CounterStatsUtil(dashboardStorage);
        }
Example #4
0
        public override bool Init(IDictionary <string, string> jobArgsDictionary)
        {
            string heartbeatconfig = JobConfigurationManager.TryGetArgument(jobArgsDictionary, JobArgumentNames.HeartbeatConfig);

            if (string.IsNullOrEmpty(heartbeatconfig))
            {
                heartbeatconfig = DefaultConfig;
            }

            DashboardStorage = CloudStorageAccount.Parse(
                JobConfigurationManager.GetArgument(jobArgsDictionary,
                                                    JobArgumentNames.DashboardStorageAccount, EnvironmentVariableKeys.StorageDashboard));

            DashboardStorageContainerName = JobConfigurationManager.TryGetArgument(jobArgsDictionary, JobArgumentNames.DashboardStorageContainer) ?? DefaultDashboardContainerName;


            DashboardStorageContainer = DashboardStorage.CreateCloudBlobClient().GetContainerReference(DashboardStorageContainerName);

            LogFileSuffix = JobConfigurationManager.TryGetArgument(jobArgsDictionary, JobArgumentNames.LogFileSuffix);

            if (LogFileSuffix == null)
            {
                throw new InvalidOperationException("LogFileSuffix argument must be specified. EXAMPLE USAGE: -LogFileSuffix v2");
            }

            // Read Config File and get values
            ReadConfigFile(heartbeatconfig);

            foreach (var jobName in JobsToMonitor.Keys)
            {
                LastCheckedForJob[jobName] = null;
            }

            foreach (var jobName in JobsToMonitor.Keys)
            {
                JobSucceeded[jobName] = false;
            }

            // Initialize Log File names
            VerboseLogFileName = GenerateLogFileName("ProcessRecyle_Verbose_");
            ConciseLogFileName = GenerateLogFileName("ProcessRecyle_Concise_");
            AlertLogFileName   = GenerateLogFileName("ProcessRecyle_Alert_");

            //Initialize Event Log
            AppEventLog     = new EventLog();
            AppEventLog.Log = "Application";

            // Record process information
            foreach (var jobName in JobsToMonitor.Keys)
            {
                RecordProcessInformation(jobName, "START");
            }

            return(true);
        }
Example #5
0
        public CounterStatsUtil(DashboardStorage storage)
        {
            var client = storage.StorageAccount.CreateCloudTableClient();

            _testCacheEntityUtil = new CounterEntityUtil <TestCacheCounterEntity>(
                client.GetTableReference(AzureConstants.TableNames.TestCacheCounter),
                x => new TestCacheCounterEntity(x));
            _unitTestEntityUtil = new CounterEntityUtil <UnitTestCounterEntity>(
                client.GetTableReference(AzureConstants.TableNames.UnitTestQueryCounter),
                x => new UnitTestCounterEntity(x));
            _testRunEntityUtil = new CounterEntityUtil <TestRunCounterEntity>(
                client.GetTableReference(AzureConstants.TableNames.TestRunCounter),
                x => new TestRunCounterEntity(x));
        }
Example #6
0
        // Please set the following connection strings in app.config for this WebJob to run:
        // AzureWebJobsDashboard and AzureWebJobsStorage
        public static void Main()
        {
            var connectionString = CloudConfigurationManager.GetSetting(SharedConstants.StorageConnectionStringName);
            var storage          = new DashboardStorage(connectionString);

            AzureUtil.EnsureAzureResources(storage.StorageAccount);

            // Manually set the values vs. reading from connectionStrings.  Developing with connectionString
            // values is dangerous because you have to keep the password in the developer directory.  Can't use
            // relative source paths to find it above it.  So keep using appSettings here and just copy the
            // values over.
            var config = new JobHostConfiguration();

            config.DashboardConnectionString = connectionString;
            config.StorageConnectionString   = connectionString;
            config.UseTimers();

            var host = new JobHost(config);

            host.RunAndBlock();
        }
Example #7
0
 public ReportsController(IMobfoxService mobfoxService, DashboardStorage storage)
 {
     _mobfoxService = mobfoxService;
     _storage       = storage;
 }