Skip to content

Inconsistent status returned by Get-AzSqlDatabaseImportExportStatus #13529

@aleksandrshvets

Description

@aleksandrshvets

Az.Sql 2.11.1
PowerShell 7.0.3

According to documentation the status of database import operation could be verified by checking Status field of the object returned by Get-AzSqlDatabaseImportExportStatus cmdlet.

$importStatus = Get-AzSqlDatabaseImportExportStatus -OperationStatusLink $importRequest.OperationStatusLink

[Console]::Write("Importing")
while ($importStatus.Status -eq "InProgress") {
    $importStatus = Get-AzSqlDatabaseImportExportStatus -OperationStatusLink $importRequest.OperationStatusLink
    [Console]::Write(".")
    Start-Sleep -s 10
}

[Console]::WriteLine("")
$importStatus

However the values of Status field can also be: "Pending" and "Running, Progress = 5.00 %". They does not indicate error and the import is considered to be still in the progress.

Can this behavior be fixed so that only "InProgress" Status field value will mean that import is still in the progress ?
If it is not possible can someone provide correct code snippet to wait for import operation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    SQLService AttentionThis issue is responsible by Azure service team.customer-reportedneeds-team-attentionThis issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions