1
votes

Followed Export SQL database example using link :

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

Getting below error:

New-AzureRmSqlDatabaseExport : ResourceNotFound: The Resource 'Microsoft.Sql/servers/XXX.database.windows.net/databases/[DBNAME]' under resource group 'Default-SQL-SoutheastAsia' was not found. At [FilePath]\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 : Cannot bind argument to parameter 'OperationStatusLink' because it is null. At [FilePath]\sample.ps1:30 char:63 + Get-AzureRmSqlDatabaseImportExportStatus -OperationStatusLink $exportRequest.Ope ... + CategoryInfo : InvalidData: (:) [Get-AzureRmSqlDatabaseImportExportStatus], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.Azure.Commands.Sql.ImportExport.Cmdlet.GetAzureSqlDatabaseImportExportStatus

Any help?

2
The error is telling you that the databasee does not exist, have you confirmed that it does and is accessible from the session you are running the script from?Mike Garuccio
Please include the command you used to trigger the export. See How to create a Minimal, Complete, and Verifiable exampleTravisEz13
Thanks for the reply. Database I am tryring to export is under "Default-SQL-SoutheastAsia" resource group. I am using below command: New-AzureRmSqlDatabaseExport -ServerName "xxxxx.database.windows.net" -AuthenticationType Sql -AdministratorLogin "xxx@xxxxx" -DatabaseName "xxxxx" -StorageUri "xxxxxxx.blob.core.windows.net/xxxxx" -StorageKey "xxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==" –ResourceGroupName "Default-SQL-SoutheastAsia" –StorageKeytype "StorageAccessKey"Krrish

2 Answers

13
votes

I had this same issue today, actually. I think if you change your server name to not use the fully-qualified name, that might do it. So, just use "xxxxx."

At least that's what worked for me.

1
votes

You need to verify that your Automation account has latest modules imported and are up to date (AzureRM.Automation – AzureRM.Profile – AzureRM.Sql) atleast to Version: 2.5.0. If modules show a different version, i.e. 1.0.3 then: navigate to assets in the automation account, select modules and click on Update Azure Modules

. Update the Azure PS modules

Wait for the modules to get updated it normally takes a few minutes