Auto Scale Maria database for Azure Programatically or with Runbook

Bhushan Gawale 316 Reputation points
2020-10-07T03:31:22.437+00:00

Hello,

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.

E.g.

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

$server.SkuCapacity = 4

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

Accepted answer
  1. Anurag Sharma 17,606 Reputation points
    2020-10-12T13:04:25.827+00:00

    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,226 Reputation points Microsoft Employee
    2020-10-09T01:25:31.34+00:00

    @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.

    Thanks
    Navtej S

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.