Share via

Exporting Azure Sql Database giving resource database not found

Arvind 51 Reputation points
2020-07-17T07:00:05.183+00:00

Hi, I was running the command to export database to azure storage using below command, but it throw error when i run it. I checked and all entries looks fine. I am using the same database login and password. I can login using same in azure sql database. Stoage account is also created.

Command: az sql db export --admin-password "xxxxxx" --admin-user "testadmin" --server xxxxxxx.database.windows.net --name "teststorageacc" --resource-group "xxxxxxx" --storage-key "xxxx-------" --storage-key-type StorageAccessKey --storage-uri "xxxxx.blob.core.windows.net/test/testdb"

error: The Resource 'Microsoft.Sql/servers/xxxxx.database.windows.net/databases/teststorageacc' under resource group 'xxxxx' was not found. For more details

I created database again but same error.

Azure SQL Database
0 comments No comments

Answer accepted by question author

Anurag Sharma 17,636 Reputation points
2020-07-17T07:26:20.207+00:00

Hi @Arvind-2274,

Please check below details:

  1. Go to Azure Sql Database and check the resource group name if it is matching with the name you provided in the command. Check below screenshot:

12785-image.png

  1. Remove the complete server address from command and just use the server name:
    xxxxxxx.database.windows.net ---> xxxxxxx
  2. Also check the firewall settings of Azure Sql server.

Please refer to similar issues if more details needed:
https://stackoverflow.com/questions/57986477/the-resource-sql-server-under-resource-group-was-not-found
https://learn.microsoft.com/en-us/answers/questions/47129/index.html


If an Answer is helpful, please “Accept Answer” or Up-Vote for the same which might be beneficial to other community members reading this thread.

Was this answer helpful?

1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Vaibhav Chaudhari 39,011 Reputation points Volunteer Moderator
    2020-07-17T08:06:54.283+00:00

    Microsoft.Sql/servers/xxxxx.database.windows.net/databases/teststorageacc

    Is the DB name given is correct? Is it teststorageacc? Looks like this is the name of storage account.


    If the response helped, do "Accept Answer" and upvote it -- Vaibhav

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.