使用 powershell 导出 azure db 时出错

Getting error while exporting azure db using powershell

使用 link 导出 SQL 数据库示例:

https://docs.microsoft.com/en-us/azure/sql-database/sql-database-export-powershell#export-sql-database-example

出现以下错误:

New-AzureRmSqlDatabaseExport:ResourceNotFound:资源组 'Default-SQL-SoutheastAsia' 下的资源 'Microsoft.Sql/servers/XXX.database.windows.net/databases/[DBNAME]' 是 未找到。 在 [文件路径]\sample.ps1:24 char:18 + $exportRequest = New-AzureRmSqlDatabaseExport –ResourceGroupName $ResourceGroupN ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [New-AzureRmSqlDatabaseExport], CloudException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Sql.ImportExport.Cmdlet.NewAzureSqlDatabaseExport

Get-AzureRmSqlDatabaseImportExportStatus:无法将参数绑定到参数 'OperationStatusLink',因为它为空。 在 [文件路径]\sample.ps1:30 char:63 + 获取 AzureRmSqlDatabaseImportExportStatus -OperationStatusLink $exportRequest.Ope ... + CategoryInfo:无效数据:(:) [Get-AzureRmSqlDatabaseImportExportStatus],ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.Azure.Commands.Sql.ImportExport.Cmdlet.GetAzureSqlDatabaseImportExportStatus

有什么帮助吗?

实际上,我今天遇到了同样的问题。我认为如果您将服务器名称更改为不使用完全限定名称,那可能会成功。所以,只需使用 "xxxxx."

至少这对我有用。

您需要验证您的自动化帐户是否已导入最新模块并且是最新的 (AzureRM.Automation – AzureRM.Profile – AzureRM.Sql) 至少版本:2.5.0。如果模块显示不同的版本,即 1.0.3 那么: 导航到自动化帐户中的资产,select 模块并单击 更新 Azure 模块

等待模块更新,通常需要几分钟