Auto Scale Maria database for Azure Programatically or with Runbook

Bhushan Gawale 301 Reputation points


Is there any way to scale up or down Azure database for Maria DB instance using Azure PowerShell or using Azure CLI?
We are looking to build a webhook enabled automation runbook that can be invoked from upstream systems and get database scaled up or down before hand.

We tried exploring the PS command Update-AzMariaDbServer however it does not seem to be updating the server to specific tier even when updated server object with SkuCapacity is provided.

Note that it is only the Sky Capacity we are looking to increase or decrease with this approach and not the storage capacity.


$server = Get-AzMariaDbServer -Name "dbName" -ResourceGroupName "rgName"

$server.SkuCapacity = 4

Update-AzMariaDbServer -InputObject $server
Azure Database for MariaDB
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,075 questions
{count} vote

Accepted answer
  1. Anurag Sharma 17,536 Reputation points

    Hi @Bhushan Gawale , adding on top of the information provided by @Navtej Singh Saini , below PowerShell command can be run to update the sku capacity:

    Update-AzMariaDbServer -Name xyz -ResourceGroupName abc -Sku GP_Gen5_32  

    Please notice that here we are not changing the tier but increasing the vCores to 32. The last numeric part will represent the change. Few example below:

    1). Changing from general purpose 4 vCores to general purpose 16 vCores:

    Update-AzMariaDbServer -Name xyz -ResourceGroupName abc -Sku GP_Gen5_16  

    2). Changing from general purpose 4 vCores to memory optimized 2 vCores:

    Update-AzMariaDbServer -Name xyz -ResourceGroupName abc -Sku MO_Gen5_2  

    Please note that changing to and from the Basic compute tier or changing the backup redundancy options after server creation is not supported.

    Please let us know if this helps or we can discuss further on the issue.

    2 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Navtej Singh Saini 4,216 Reputation points Microsoft Employee

    @Bhushan Gawale

    Thanks for your patience. We found two document in this regard. First one has been shared by our support to Cx and is applicable for Maria DB as well. It is an example of scaling up using Runbooks.

    Second one is CLI example for achieving the scaling of Maria DB resources.

    Please go through both and let us know if it helps and if you have any questions.

    Navtej S

    1 person found this answer helpful.
    0 comments No comments