/// <summary>
        /// Connect to an Azure subscription and change the configuration of a deployment.
        /// </summary>
        /// <returns>The asynchronous operation identifier.</returns>
        protected override string AzureExecute()
        {
            var changeInput = this.CreateConfigurationInput();

            using (new OperationContextScope((IContextChannel)Channel))
            {
                try
                {
                    if (this.action == ChangeDeploymentConfigurationAction.ChangeByDeploymentName)
                    {
                        this.RetryCall(s => this.Channel.ChangeConfiguration(s, this.ServiceName.Get(this.ActivityContext), this.DeploymentName.Get(this.ActivityContext), changeInput));
                    }
                    else
                    {
                        this.RetryCall(s => this.Channel.ChangeConfigurationBySlot(s, this.ServiceName.Get(this.ActivityContext), this.Slot.Get(this.ActivityContext), changeInput));
                    }

                    return(BaseAzureAsynchronousActivity.RetrieveOperationId());
                }
                catch (EndpointNotFoundException ex)
                {
                    this.LogBuildMessage(ex.Message);
                    return(null);
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Connect to an Azure subscription and obtain a certificate.
        /// </summary>
        /// <returns>The asynchronous operation identifier.</returns>
        protected override string AzureExecute()
        {
            CertificateFile file = this.CreateFileFromCertificate();

            try
            {
                this.RetryCall(s => this.Channel.AddCertificates(s, this.ServiceName.Get(this.ActivityContext), file));
                return(BaseAzureAsynchronousActivity.RetrieveOperationId());
            }
            catch (EndpointNotFoundException ex)
            {
                this.LogBuildMessage(ex.Message);
                return(null);
            }
        }
Beispiel #3
0
 /// <summary>
 /// Connect to an Azure subscription and remove the named deployment.
 /// </summary>
 /// <returns>The asynchronous operation identifier.</returns>
 protected override string AzureExecute()
 {
     using (new OperationContextScope((IContextChannel)Channel))
     {
         try
         {
             this.RetryCall(s => this.Channel.DeleteDeploymentBySlot(s, this.ServiceName.Get(this.ActivityContext), this.Slot.Get(this.ActivityContext)));
             return(BaseAzureAsynchronousActivity.RetrieveOperationId());
         }
         catch (EndpointNotFoundException ex)
         {
             this.LogBuildMessage(ex.Message);
             return(null);
         }
     }
 }
Beispiel #4
0
 /// <summary>
 /// Connect to an Azure subscription and obtain a certificate.
 /// </summary>
 /// <returns>The asynchronous operation identifier.</returns>
 protected override string AzureExecute()
 {
     try
     {
         this.RetryCall(s => this.Channel.DeleteCertificate(
                            s,
                            this.ServiceName.Get(this.ActivityContext),
                            this.ThumbprintAlgorithm.Get(this.ActivityContext),
                            this.CertificateThumbprintId.Get(this.ActivityContext)));
         return(BaseAzureAsynchronousActivity.RetrieveOperationId());
     }
     catch (EndpointNotFoundException ex)
     {
         this.LogBuildMessage(ex.Message);
         return(null);
     }
 }
        /// <summary>
        /// Connect to an Azure subscription and reimage a deployment.
        /// </summary>
        /// <returns>The asynchronous operation identifier.</returns>
        protected override string AzureExecute()
        {
            try
            {
                if (this.Action == ReimageRoleInstanceAction.ReimageByInstanceName)
                {
                    this.RetryCall(s => this.Channel.ReimageDeploymentRoleInstance(s, this.ServiceName.Get(this.ActivityContext), this.DeploymentName.Get(this.ActivityContext), this.InstanceName.Get(this.ActivityContext)));
                }
                else
                {
                    this.RetryCall(s => this.Channel.ReimageDeploymentRoleInstanceBySlot(s, this.ServiceName.Get(this.ActivityContext), this.Slot.Get(this.ActivityContext), this.InstanceName.Get(this.ActivityContext)));
                }

                return(BaseAzureAsynchronousActivity.RetrieveOperationId());
            }
            catch (EndpointNotFoundException ex)
            {
                this.LogBuildMessage(ex.Message);
                return(null);
            }
        }
Beispiel #6
0
        /// <summary>
        /// Connect to an Azure subscription and execute a VIP swap.
        /// </summary>
        /// <returns>The asynchronous operation identifier.</returns>
        protected override string AzureExecute()
        {
            var swapDeploymentInput = new SwapDeploymentInput
            {
                SourceDeployment = this.StagingDeploymentName.Get(this.ActivityContext),
                Production       = this.ProductionDeploymentName.Get(this.ActivityContext)
            };

            using (new OperationContextScope((IContextChannel)Channel))
            {
                try
                {
                    this.RetryCall(s => this.Channel.SwapDeployment(s, this.ServiceName.Get(this.ActivityContext), swapDeploymentInput));
                    return(BaseAzureAsynchronousActivity.RetrieveOperationId());
                }
                catch (EndpointNotFoundException ex)
                {
                    this.LogBuildMessage(ex.Message);
                    return(null);
                }
            }
        }