Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve error "Can not perform requested operation on nested resource. Parent resource not found" az sql db import throws

As part of my Azure Devops release pipeline I want to restore the bacpac of the previous days data from Azure storage.

I am running the following az command

az sql db import -s myprod.database.windows.net -n mydb
-g myresourcegroup -p "${mypassword}" -u myuser
--storage-key "${mystoragekey}" --storage-key-type StorageAccessKey 
--storage-uri 
"https://mystore.blob.core.windows.net/db/bk$(date -d "yesterday" '+%Y-%m-%d').bacpac"

This command fails with the following ERROR: Can not perform requested operation on nested resource. Parent resource 'myprod.database.windows.net/mydb' not found.

The db already exists on the server. Is this saying that the parent in this case is the server or the db? It should be able to find both

like image 202
Declan McNulty Avatar asked Dec 20 '18 09:12

Declan McNulty


1 Answers

.database.windows.net should not be there. myprod.database.windows.net is the server's fully qualified DNS name, but in the API the server's "name" is just myprod.

Hope this helps.

like image 94
CHEEKATLAPRADEEP-MSFT Avatar answered Nov 02 '22 06:11

CHEEKATLAPRADEEP-MSFT