[SQL-Database] Get allowed maximum data storage capacity for a Sql database

Rushikesh Gaidhani 161 Reputation points
2023-11-17T23:57:13.5033333+00:00

I have a database with the following setup (2vCores and 500GB max size)

User's image

I want to increase the allocated max size from say 500GB to 600GB but, before performing that operation I would like to check if there is enough space for it.

I can get the existing maximum storage size (500GB) with the property "MaxSizeBytes" from the cmdlet Get-AzSqlDatabase.

Get-AzSqlDatabase -ServerName <server-name> -DatabaseName <database-name> -ResourceGroupName <resource-group-name>

how do I get the allowed maximum storage capacity using the PowerShell for the same 2vCores which is 1024GB? Is there any specific metric which from which I can get this information instead of from the portal?

Azure SQL Database
Windows for business | Windows Server | User experience | PowerShell
{count} votes

1 answer

Sort by: Most helpful
  1. RahulRandive 10,501 Reputation points Volunteer Moderator
    2023-11-18T00:25:53.3666667+00:00

    Hi @Rushikesh Gaidhani

    I believe you can check from the portal -- Overview page of SQL Database and you can find used, remaining, allocated and max storage details.

    User's image

    You can also use below powershell command and get the MaxSizeBytes details.

    Get-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName

    User's image

    Thank you!


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.