Auto grow storage in Azure Database for MariaDB server using PowerShell

Important

Azure Database for MariaDB is on the retirement path. We strongly recommend that you migrate to Azure Database for MySQL. For more information about migrating to Azure Database for MySQL, see What's happening to Azure Database for MariaDB?.

This article describes how you can configure an Azure Database for MariaDB server storage to grow without impacting the workload.

Storage auto grow prevents your server from reaching the storage limit and becoming read-only. For servers with 100 GB or less of provisioned storage, the size is increased by 5 GB when the free space is below 10%. For servers with more than 100 GB of provisioned storage, the size is increased by 5% when the free space is below 10 GB. Maximum storage limits apply as specified in the storage section of the Azure Database for MariaDB pricing tiers.

Important

Remember that storage can only be scaled up, not down.

Prerequisites

To complete this how-to guide, you need:

Important

While the Az.MariaDb PowerShell module is in preview, you must install it separately from the Az PowerShell module using the following command: Install-Module -Name Az.MariaDb -AllowPrerelease. Once the Az.MariaDb PowerShell module is generally available, it becomes part of future Az PowerShell module releases and available natively from within Azure Cloud Shell.

If you choose to use PowerShell locally, connect to your Azure account using the Connect-AzAccount cmdlet.

Enable MariaDB server storage auto grow

Enable server auto grow storage on an existing server with the following command:

Update-AzMariaDbServer -Name mydemoserver -ResourceGroupName myresourcegroup -StorageAutogrow Enabled

Enable server auto grow storage while creating a new server with the following command:

$Password = Read-Host -Prompt 'Please enter your password' -AsSecureString
New-AzMariaDbServer -Name mydemoserver -ResourceGroupName myresourcegroup -Sku GP_Gen5_2 -StorageAutogrow Enabled -Location westus -AdministratorUsername myadmin -AdministratorLoginPassword $Password

Next steps