Exemplo n.º 1
0
        /// <summary>
        /// Deletes a cloud service and all its deployments
        ///
        /// BILLING Stops here!
        /// </summary>
        /// <param name="name"></param>
        public void DeleteCloudService(string name)
        {
            using (ComputeManagementClient client =
                       CloudContext.Clients.CreateComputeManagementClient(_credentials))
            {
                var answer = client.Deployments.DeleteBySlot(name, DeploymentSlot.Production);

                while (client.GetOperationStatus(answer.RequestId).Status != OperationStatus.Succeeded)
                {
                    Thread.Sleep(5000);
                }
                client.HostedServices.Delete(name);
            }
        }