Share via

Can not perform requested operation on nested resource. Parent resource not found

pragadeesh.raju 41 Reputation points
2020-07-15T06:14:50.94+00:00

Hi,

When I tried to use az SQL import, I'm getting the following error,
what might be the cause and solution for this?
I went through this https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/error-parent-resource
but it didn't help, I have created the resources one after another.

az sql db import --resource-group "test" --server "testsqlsvr.database.windows.net" --name "TEST_DB"   
--storage-key-type "StorageAccessKey" --storage-key "wegfiajebfkjsbfiusdkbszzzzzxxxxxxxxxxxxxxxxx==" --storage-uri "https://test/asdb.bacpac" -u "user" -p "password"  
Can not perform requested operation on nested resource. Parent resource 'testsqlsvr.database.windows.net/TEST_DB' not found.  

What I am trying to do is, importing the data azure sql server from the bacpac.

Azure Migrate
Azure Migrate

A central hub of Azure cloud migration services and tools to discover, assess, and migrate workloads to the cloud.

Azure Database for MySQL
0 comments No comments

2 answers

Sort by: Most helpful
  1. Anurag Sharma 17,636 Reputation points
    2020-07-15T08:17:15.293+00:00

    Hi @pragadeeshraju-2799, you need to change the server's fully qualified name from '--server "testsqlsvr.database.windows.net"' to '--server "testsqlsvr" '.

    Below is the command you can use:

    az sql db import --resource-group "test" --server "testsqlsvr" --name "TEST_DB"
    --storage-key-type "StorageAccessKey" --storage-key "wegfiajebfkjsbfiusdkbszzzzzxxxxxxxxxxxxxxxxx==" --storage-uri "https://test/asdb.bacpac" -u "user" -p "password"


    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.

  2. Sam Cogan 10,867 Reputation points Microsoft Employee
    2020-07-15T07:12:05.547+00:00

    The error indicates that it cannot find the database you are trying to import into. Az sql db import imports a bacpac into an existing DB, so you must have already created that DB and server before running this command. If you have already created this, make sure that the Azure CLI is configured to use the subscription that the DB is in using az account set --subscription

    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.