Skip to content

Latest commit

 

History

History
69 lines (44 loc) · 2.94 KB

File metadata and controls

69 lines (44 loc) · 2.94 KB

Autoscale IOPS for multiple Azure MySQL Flexible Server

Costa Rica

GitHub brown9804

Last updated: 2025-05-13


Using Python 3.7+

Note

Enable Autoscale IOPS via REST API, as now this is the only way to automate enabling Autoscale IOPS since, Azure CLI and PowerShell do not support this setting yet.

Important

Autoscale IOPS is only available for the General Purpose and Business Critical tiers. Burstable tier (B-series) servers (e.g., B1ms) do not support autoscale IOPS.

Pre-requisites

  • Install azure-identity with: py -m pip install azure-identity requests

    image
  • Install Azure CLI.

    image

By Resource Group

Overall process:

  • Automatically retrieves your Azure subscription ID using the Azure CLI.
  • List all Resource Groups in current subscription ID.
  • Prompts you only for the resource group name.
  • Lists all MySQL Flexible Servers in that resource group. Few conditions were added to review which servers are available for update.
  • Sends a PATCH request to enable autoIoScaling for each server using the Azure REST API

Review the script, and download it to your local machine.

Example: enabling Autoscale IOPS on two different servers, each hosted in same resource group and same subscription.

E.g.enabling.Autoscale.IOPS.on.two.different.servers.each.hosted.in.same.resource.group.and.same.subscription.mp4

Across a Subscription

You can also enable autoscale IOPS across an entire subscription, overall process:

  • Listing all MySQL Flexible Servers in the subscription.
  • For each server, retrieving its resource group.
  • Applying the update if the server is in a supported tier (General Purpose or Business Critical).

Review the script, and download it to your local machine.

Example: enabling Autoscale IOPS on 4 different servers, each hosted in different resource group and same subscription.

image

How to execute it Script to Enable Autoscale IOPS

  1. Download the script to be used to your local machine or a cloud shell environment.
  2. Make sure you're logged in: az login
  3. Run the script: python {script-name}.py

Total Visitors

Visitor Count