Get-AzSqlDatabase only returns 100 databases.
How to get all?
Get-AzSqlDatabase only returns 100 databases.
How to get all?
What is the count it returns when you run below:
$a = get-azsqldatabase -servername YourServerName -resourcegroupname YourRG
$a.count
Hi @PoulChristensen-5014, welcome to Microsoft Q&A forum.
Get-AzSqlDatabase displays all the databases and would not limit the number to 100. I tried creating more than 100 databases and with 'Get-AzSqlDatabase I was able to return it all. We can also check the count of databases using same command to be sure.
However when we run the same command using Azure Portal PowerShell or Windows PowerShell, there are chances that the result would not show all databases due to text truncation. I would suggest you to export the result of the command through Windows PowerShell and verify the same.
Get-AzSqlDatabase -servername <servername> -resourcegroupname <resgrpname> | Export-Csv -Path "<path/nameoffile>.csv"
Please let us know if this helps or else we can discuss further.
If answer helps, you can mark it 'Accept Answer'
Thanks for the quick reply and you are completely right
When I try this from Azure Powershell i get 100
When I try the same from WIndows Powershell i get the correct 256 databases
11 people are following this question.