Getting error while importing database in Azure China via Azure DevOps pipeline

Sundar 1 Reputation point
2021-04-21T09:54:14.933+00:00

I am trying to import a database from the storage account using an Azure DevOps pipeline in Azure China, but getting an API version error. I am using the New-AzSqlDatabaseImport module to do the import via an Azure Powershell task.

No registered resource provider found for location 'chinaeast2' and API version '2020-02-02-preview' for type 'servers/import'. The supported api-versions are '2014-04-01, 2014-04-01-preview'. The supported locations are 'chinaeast, chinaeast2, chinanorth, chinanorth2'. PowerShell exited with code '1'.
Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Anurag Sharma 17,261 Reputation points
    2021-04-21T13:12:19.197+00:00

    Hi @Sundar , welcome to Microsoft Q&A forum.

    Please ensure that latest Az PowerShell versions are installed on Microsoft/Self-hosted agent on DevOps pipeline and try running once.

    If you still see the same issue that means as per the error message, this API '2020-02-02-preview' is not supported in the mentioned region. We would not be able to import through the PowerShell commands and will need to import the bacpac in other supported region.

    Please let us know if this helps or we can discuss further.

    ----------

    If answer helps, please mark it 'Accept Answer'