Cannot retrieve Status of Successful AZ Powershell SQL Import - 403 error

Chris Recknell 106 Reputation points
2020-12-09T11:09:46.433+00:00

Hi,

I have submitted a New-AzSqlDatabaseImport command which is accepted by Azure and can be monitored to completion in the portal. However, when I try to access the OperationStatusLink in Azure PowerShell, I receive a 403 error.

$importStatus = Get-AzSqlDatabaseImportExportStatus -OperationStatusLink $importRequest.OperationStatusLink
Get-AzSqlDatabaseImportExportStatus: Response status code does not indicate success: 403 (Forbidden).

Can anyone let me know what I'm missing?

Many thanks,

Chris

Azure SQL Database
{count} votes

Accepted answer
  1. Chris Recknell 106 Reputation points
    2020-12-11T12:21:08.1+00:00

    Thank you for your responses, I received this service alert yesterday:

    Starting at approximately 28 Oct 2020, you have been identified as a customer using Azure SQL Database (DB) who may have experienced issues where the import/export status of your Azure SQL import/export operations will return incorrect values in the Status and StatusMessage fields. Additionally, you may have seen permission level failures when using Powershell.

    Workaround: Customers can use previous versions (4.8.0 or earlier) of Powershell with no restrictions.

    Current status: We have identified a possible preliminary root cause and are investigating mitigation steps. The next update will be upon mitigation, or as events warrant.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anurag Sharma 17,581 Reputation points
    2020-12-10T09:08:39.143+00:00

    Hi @Chris Recknell , welcome to Microsoft Q&A forum.

    Would it be possible for you to share the commands please? Also any article if you are following for this activity.

    Meanwhile below commands worked for me:

    New-AzSqlDatabaseImport -ResourceGroupName "test" -ServerName "testserver" -DatabaseName "testdb" -StorageKeyType "StorageAccessKey" -StorageKey $(Get-AzStorageAccountKey -ResourceGroupName "test" -StorageAccountName "teststorageacc").Value[0]  -StorageUri "https://zzzzzzz.blob.core.windows.net/bacpac/test2.bacpac" -AdministratorLogin "sadmin" -AdministratorLoginPassword $SecurePassword -Edition Standard -ServiceObjectiveName S3 -DatabaseMaxSizeBytes 268435456000  
    
    
    Get-AzSqlDatabaseImportExportStatus -OperationStatusLink "https://management.azure.com/subscriptions/xxxxxxxxxxxxx/providers/Microsoft.Sql/locations/eastus/importExportOperationResults/xxxxxxxxyyyyyy?api-version=2020-02-02-preview"  
    

    46865-image.png

    0 comments No comments

  2. Taiob Ali 101 Reputation points MVP
    2020-12-10T18:56:26.677+00:00

    I have used the following code and worked fine for me.
    Az module version 3.4.0

    $PSVersionTable
    

    PSVersion 7.1.0
    PSEdition Core
    GitCommitId 7.1.0
    OS Microsoft Windows 10.0.18363
    Platform Win32NT
    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
    PSRemotingProtocolVersion 2.3
    SerializationVersion 1.1.0.1
    WSManStackVersion 3.0

    Login-AzAccount
    
    Set-AzContext -SubscriptionId 'SubscriptionId'
    
    $importRequest = New-AzSqlDatabaseImport -ResourceGroupName "taiobtest-rg" -ServerName taiobtest -DatabaseName 
    taiobtestdb -StorageKeyType StorageAccessKey -StorageKey "storage key" -StorageUri "https://storage 
    url/bacpac/dbadatabase.bacpac" -Edition Standard -ServiceObjectiveName S0 -DatabaseMaxSizeBytes 524288000 -AuthenticationType 
    SQL  
    
    Get-AzSqlDatabaseImportExportStatus -OperationStatusLink $importRequest.OperationStatusLink
    

    Some output from the last line:

    OperationStatusLink : https://management.azure.com/subscriptions/Subscription Id/resourceGroups/taiobtest-rg/providers/Microsoft.Sql/servers/taiobtest/impor
    tExportOperationResults/ccb9f4a6-0d72-4f5d-97b9-c4ebb923a9e0?api-version=2014-04-01-Preview
    ErrorMessage :
    LastModifiedTime : 12/10/2020 6:43:42 PM
    QueuedTime : 12/10/2020 6:43:41 PM
    StatusMessage : Running, Progress = 5.00 %
    Status : InProgress

    OperationStatusLink : https://management.azure.com/subscriptions/Subscription Id/resourceGroups/taiobtest-rg/providers/Microsoft.Sql/servers/taiobtest/impor
    tExportOperationResults/ccb9f4a6-0d72-4f5d-97b9-c4ebb923a9e0?api-version=2014-04-01-Preview
    ErrorMessage :
    LastModifiedTime :
    QueuedTime :
    StatusMessage :
    Status : Succeeded

    0 comments No comments