示例#1
0
        internal static DeploymentCreateForecastWorker[] GetDeploymentCreateForecastWorkers()
        {
            IConfigurationSource configurationSource = GetConfigurationSource();
            ArrayList            list = new ArrayList();

            foreach (DeploymentCreateConfiguration deploymentCreateConfiguration in configurationSource.GetWindowsAzureDeploymentCreateConfigurations())
            {
                SubscriptionConfiguration subscriptionConfiguration = configurationSource.GetWindowsAzureSubscriptionConfiguration(deploymentCreateConfiguration.SubscriptionConfigurationId);
                PackageConfiguration      packageConfiguration      = configurationSource.GetWindowsAzurePackageConfiguration(deploymentCreateConfiguration.WindowsAzurePackageId);
                foreach (ScheduleDefinitionConfiguration scheduleDefinitionConfiguration in deploymentCreateConfiguration.Schedules)
                {
                    ScheduleDay[] scheduleDays = GetScheduleDaysFromScheduleConfiguration(scheduleDefinitionConfiguration);
                    Uri           packageUrl   = Blob.GetUrl(packageConfiguration.StorageAccountName, packageConfiguration.ContainerName, packageConfiguration.BlobName);
                    DeploymentCreateForecastWorker deploymentCreateForecastWorker = new DeploymentCreateForecastWorker(
                        new Deployment(),
                        new Operation(),
                        subscriptionConfiguration.SubscriptionId,
                        subscriptionConfiguration.CertificateThumbprint,
                        deploymentCreateConfiguration.ServiceName,
                        deploymentCreateConfiguration.DeploymentSlot,
                        scheduleDays,
                        deploymentCreateConfiguration.DeploymentName,
                        packageUrl,
                        deploymentCreateConfiguration.DeploymentLabel,
                        deploymentCreateConfiguration.PackageConfigurationFilePath,
                        deploymentCreateConfiguration.StartDeployment,
                        deploymentCreateConfiguration.TreatWarningsAsError,
                        deploymentCreateConfiguration.PollingIntervalInMinutes);
                    list.Add(deploymentCreateForecastWorker);
                }
            }

            return((DeploymentCreateForecastWorker[])list.ToArray(typeof(DeploymentCreateForecastWorker)));
        }