/// <summary>
 /// Deletes a deployment to make space for a new one!
 /// </summary>
 private void DeleteDeployment()
 {
     // most likely there is something in the slot ...
     var deleteDeployment = new DeleteDeploymentCommand(_manager.HostedServiceName, _manager.DeploymentSlot)
                                {
                                    Certificate = _manager.ManagementCertificate,
                                    SubscriptionId = _manager.SubscriptionId
                                };
     deleteDeployment.Execute();
 }
Exemplo n.º 2
0
 /// <summary>
 /// Used to delete a deployment in a respective slot 
 /// </summary>
 /// <param name="slot">Either production or staging</param>
 public void DeleteDeployment(DeploymentSlot slot = DeploymentSlot.Production)
 {
     var deleteDeployment = new DeleteDeploymentCommand(Name, slot)
     {
         Certificate = ManagementCertificate,
         SubscriptionId = SubscriptionId
     };
     deleteDeployment.Execute();
 }
 public void Delete()
 {
     try
     {
         var deleteDeployment = new DeleteDeploymentCommand(_manager.HostedServiceName, DeploymentSlot.Production)
                                    {
                                        Certificate = _manager.ManagementCertificate,
                                        SubscriptionId = _manager.SubscriptionId
                                    };
         deleteDeployment.Execute();
         deleteDeployment.DeploymentSlot = DeploymentSlot.Staging;
         deleteDeployment.Execute();
     }
     catch (Exception)
     {
         // no deployment here who cares!
     }
     // delete the hosted service
     var deleteService = new DeleteHostedServiceCommand(_manager.HostedServiceName)
                             {
                                 Certificate = _manager.ManagementCertificate,
                                 SubscriptionId = _manager.SubscriptionId
                             };
     deleteService.Execute();
 }