Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SQL Azure rest api BeginExport。。。如何检查导出是否已完成_Sql_Azure_Azure Sql Database - Fatal编程技术网

SQL Azure rest api BeginExport。。。如何检查导出是否已完成

SQL Azure rest api BeginExport。。。如何检查导出是否已完成,sql,azure,azure-sql-database,Sql,Azure,Azure Sql Database,我需要以编程方式将SQL Azure数据库导出到BACPAC文件,导出完成后,我需要删除该数据库 SQLAzure RESTAPI允许我提交导出请求,该请求将运行并将数据库导出到blob存储容器 但是。。。我看不出如何检查导出请求的状态 以下是导出api说明: SQL api的总体描述:sys.dm uu operation u status DMV应该可以帮助您了解操作的状态 SELECT * FROM sys.dm_ operation_status WHERE major_re

我需要以编程方式将SQL Azure数据库导出到BACPAC文件,导出完成后,我需要删除该数据库

SQLAzure RESTAPI允许我提交导出请求,该请求将运行并将数据库导出到blob存储容器

但是。。。我看不出如何检查导出请求的状态

以下是导出api说明:


SQL api的总体描述:

sys.dm uu operation u status DMV应该可以帮助您了解操作的状态

SELECT * FROM sys.dm_ operation_status   
   WHERE major_resource_id = ‘myddb’   
   ORDER BY start_time DESC;
有关此DMV的更多信息,请访问文档

如果使用PowerShell cmdlet,则可以使用cmdlet跟踪导出操作和导入操作的进度。

对于任何api(如BeginX()),都有一个相应的api X()等待完成。在这种情况下,请不要使用

如果您希望对轮询进行更直接的控制,那么您可以:

public async Task exportwithhttpmessageasync(字符串resourceGroupName、字符串serverName、字符串databaseName、ExportRequest参数、Dictionary customHeaders=null、CancellationToken CancellationToken=default(CancellationToken))
{
//发送请求
AzureOperationResponse _response=await BeginPortWithTtpMessageAsync(resourceGroupName、serverName、databaseName、参数、CustomHeader、cancellationToken)。ConfigureAwait(false);
//完成投票
返回wait Client.GetPostOrDeleteOperationResultAsync(_response,CustomHeader,cancellationToken);
}

这个答案是专门针对.net的,但对于其他语言,同样的原则也适用。

no。该视图不包括azure导出任务。我需要执行相同的操作,只是需要检查导入的状态,而不是导出的状态。运气好吗?@ColinLaws如果使用PowerShell New AzureRmSqlDatabaseImport,则可以使用Get-AzureRmSqlDatabaseImportStatus跟踪导入操作。
        public async Task<AzureOperationResponse<ImportExportResponse>> ExportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExportRequest parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            // Send request
            AzureOperationResponse<ImportExportResponse> _response = await BeginExportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);

            // Poll for completion
            return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
        }