Sunday, 6 August 2017

Get-AzureRmSqlDatabase : ParentResourceNotFound: Can not perform requested operation on nested resource.

While executing "Get-AzureRmSqlDatabase" PowerShell command, you may get following error "Get-AzureRmSqlDatabase : ParentResourceNotFound: Can not perform requested operation on nested resource."

This error comes when you use full server name in command. For example, 
 Get-AzureRmSqlDatabase -ResourceGroupName "RDResourceGroup" -ServerName "rndsqlserver.database.windows.net"


Just remove the full server name and it should be fine. Example,
Get-AzureRmSqlDatabase -ResourceGroupName "RDResourceGroup" -ServerName "rndsqlserver"


Hope this helps!