public async Task WaitDeployment(StartDeploymentResponse deploymentResult) { while (true) { var actualDeployment = await _client.GetDeploymentAsync(new GetDeploymentRequest() { ApplicationId = deploymentResult.ApplicationId, EnvironmentId = deploymentResult.EnvironmentId, DeploymentNumber = deploymentResult.DeploymentNumber }); Console.WriteLine($"Deployment is {actualDeployment.State}"); if (actualDeployment.State == DeploymentState.COMPLETE) { break; } if (actualDeployment.State == DeploymentState.ROLLED_BACK) { throw new Exception("An error occured during deployment, check management console for details."); } Thread.Sleep(5000); } }