protected bool DoesCloudServiceExist(string serviceName)
{
bool isPresent = false;
using (new OperationContextScope(Channel.ToContextChannel()))
{
try
{
AvailabilityResponse response = this.RetryCall(s => this.Channel.IsDNSAvailable(s, serviceName));
WaitForOperation(CommandRuntime.ToString(), true);
isPresent = !response.Result;
}
catch (ServiceManagementClientException ex)
{
if (ex.HttpStatus == HttpStatusCode.NotFound)
{
isPresent = false;
}
else
{
this.WriteErrorDetails(ex);
}
}
}
return isPresent;
}