예제 #1
0
        public WebsiteAutoscalerHelper()
        {
            // Read configuration settings.
            var subscriptionId = ConfigurationManager.AppSettings["SubscriptionId"];

            this.webspaceName    = ConfigurationManager.AppSettings["WebspaceName"];
            this.hostingPlanName = ConfigurationManager.AppSettings["HostingPlanName"];

            // Get the certificate from appsettings.
            var cert = CertificateHelper.GetCertificateFromAppSettings("ManagementCertificate");

            // Create the autoscale client.
            this.autoscaleClient = new AutoscaleClient(new CertificateCloudCredentials(subscriptionId, cert));
        }
예제 #2
0
        public VirtualMachineAutoscalerHelper()
        {
            // Read configuration settings.
            var subscriptionId = ConfigurationManager.AppSettings["SubscriptionId"];
            var certThumbprint = ConfigurationManager.AppSettings["CertThumbprint"];

            this.cloudServiceName    = ConfigurationManager.AppSettings["VirtualMachineCloudServiceName"];
            this.availabilitySetName = ConfigurationManager.AppSettings["AvailabilitySetName"];

            // Get the certificate from the local store.
            var cert = CertificateHelper.GetCertificate(StoreName.My, StoreLocation.CurrentUser, certThumbprint);

            // Create the autoscale client.
            this.autoscaleClient = new AutoscaleClient(new CertificateCloudCredentials(subscriptionId, cert));
        }
        public CloudServiceAutoscalerHelper()
        {
            // Read configuration settings.
            var subscriptionId = ConfigurationManager.AppSettings["SubscriptionId"];
            var certThumbprint = ConfigurationManager.AppSettings["CertThumbprint"];

            this.cloudServiceName = ConfigurationManager.AppSettings["CloudServiceName"];
            this.roleName         = ConfigurationManager.AppSettings["RoleName"];
            this.deploymentName   = ConfigurationManager.AppSettings["DeploymentName"];
            this.isProduction     = bool.Parse(ConfigurationManager.AppSettings["IsProduction"]);

            // Get the certificate from the local store.
            var cert = CertificateHelper.GetCertificate(StoreName.My, StoreLocation.CurrentUser, certThumbprint);

            // Create the autoscale client.
            this.autoscaleClient = new AutoscaleClient(new CertificateCloudCredentials(subscriptionId, cert));

            // Create the metrics client.
            this.metricsClient = new MetricsClient(new CertificateCloudCredentials(subscriptionId, cert));
        }