4

I am trying to get firewall rules configured on an existing azure sql server. I am using Azure Cloud shell to run the following command which results in an error.

~$ az sql server firewall-rule list --server mydbserver.database.windows.net --resource-group myresourcegroup

Can not perform requested operation on nested resource. Parent resource 'mydbserver.database.windows.net' not found.

1 Answers1

7

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

Jared Moore
  • 3,765
  • 26
  • 31
  • 1
    I tried server name without the suffix but I am getting the same error. Can not perform requested operation on nested resource. Parent resource 'mydbserver' not found. – pankaj singh Aug 10 '17 at 22:49
  • 2
    The failure was because I have multiple subscriptions on Azure and my default subscription did not have the sql-server. I changed the subscription by using az account set --subscription and now the command to get firewall works – pankaj singh Aug 10 '17 at 23:12
  • More over `Microsoft` kept updating commands, i faced a same problem because of command updates. – RajeshKdev Nov 02 '18 at 12:51
  • Man, you are a genius! That's very confusing in the API. You normally copy the whole value from the portal.. Thanks – Jose Parra Nov 16 '18 at 04:26