/// <summary> /// Cancel the elastic pool activity /// </summary> /// <param name="resourceGroupName">The name of the resource group</param> /// <param name="serverName">The name of the Azure Sql Database server</param> /// <param name="elasticPoolName">The name of the elastic pool</param> /// <param name="operationId">The Operation ID</param> /// <returns></returns> internal IEnumerable <AzureSqlElasticPoolActivityModel> CancelElasticPoolActivity(string resourceGroupName, string serverName, string elasticPoolName, Guid?operationId) { if (!operationId.HasValue) { throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, Microsoft.Azure.Commands.Sql.Properties.Resources.OperationIdRequired)); } Communicator.CancelOperation(resourceGroupName, serverName, elasticPoolName, operationId.Value); // After Cancel event is fired, state will be in 'CancelInProgress' for a while but should expect to finish in a minute return(GetElasticPoolActivity(resourceGroupName, serverName, elasticPoolName)); }