public virtual void Execute()
{
_exception = null;
var serviceManagementRequest = new ServiceManagementRequest
{
BaseUri = BaseRequestUri + (IsManagement ? ":8443" : ""),
HttpVerb = HttpVerb,
OptionalData = HttpCommand,
ServiceType = ServiceType,
OperationId = OperationId,
SubscriptionId = SubscriptionId,
Body = CreatePayload(),
Certificate = Certificate,
AdditionalHeaders = AdditionalHeaders,
ContentType = ContentType,
Accept = Accept,
RequestWithoutCertificate =
!(UseCertificate.HasValue && UseCertificate.Value)
};
CurrentQueryManager = CurrentQueryManager ?? new QueryManager();
CurrentQueryManager.MakeASyncRequest(serviceManagementRequest, ResponseCallback, ErrorResponseCallback);
// wait for up to 30 minutes - if a deployment takes longer than that ... it's probably HPC!
SitAndWait.WaitOne(200000);
if(_lastFailureResponse != null)
throw new FluentManagementException(_lastFailureResponse, "ServiceCommand");
if (_exception != null)
throw new FluentManagementWebException(_exception as WebException);
}