/// <summary> /// Exports an Azure SQL Database into a DACPAC file in Azure Blob /// Storage. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Sql.IDacOperations. /// </param> /// <param name='serverName'> /// Required. The name of the Azure SQL Database Server in which the /// database to export resides. /// </param> /// <param name='parameters'> /// Optional. The parameters needed to initiate the export request. /// </param> /// <returns> /// Represents the response that the service returns once an import or /// export operation has been initiated. /// </returns> public static DacImportExportResponse Export(this IDacOperations operations, string serverName, DacExportParameters parameters) { return Task.Factory.StartNew((object s) => { return ((IDacOperations)s).ExportAsync(serverName, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
/// <summary> /// Export DAC into Windows Azure blob storage. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Sql.IDacOperations. /// </param> /// <param name='serverName'> /// The name of the server being exported from. /// </param> /// <param name='parameters'> /// Export parameters. /// </param> /// <returns> /// Response for an DAC Import/Export request. /// </returns> public static DacImportExportResponse Export(this IDacOperations operations, string serverName, DacExportParameters parameters) { try { return operations.ExportAsync(serverName, parameters).Result; } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// Exports an Azure SQL Database into a DACPAC file in Azure Blob /// Storage. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Sql.IDacOperations. /// </param> /// <param name='serverName'> /// Required. The name of the Azure SQL Database Server in which the /// database to export resides. /// </param> /// <param name='parameters'> /// Optional. The parameters needed to initiate the export request. /// </param> /// <returns> /// Represents the response that the service returns once an import or /// export operation has been initiated. /// </returns> public static Task<DacImportExportResponse> ExportAsync(this IDacOperations operations, string serverName, DacExportParameters parameters) { return operations.ExportAsync(serverName, parameters, CancellationToken.None); }