Skip to content

Commit 5a288c0

Browse files
authored
overview going to be moved
1 parent 5e6e958 commit 5a288c0

1 file changed

Lines changed: 2 additions & 44 deletions

File tree

0_Azure/1_AzureData/1_Databases/demos/11_enablingAutoscaleIOPSmySQL/AutoscaleMultiple-IOPS.md

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ Last updated: 2025-05-12
3434
> - Lists all MySQL Flexible Servers in that resource group. <br/>
3535
> - Sends a `PATCH request`` to enable `autoIoScaling` for each server using the `Azure REST API`
3636
37-
1. Make sure you're logged in: `az login`
38-
37+
Review [the script](./enable_autoscale_iops_byRG.py), and download it to your local machine.
3938

4039
## Across a Subscription
4140

@@ -44,47 +43,7 @@ Last updated: 2025-05-12
4443
> - For each server, retrieving its resource group. <br/>
4544
> - Applying the update if the server is in a supported tier (General Purpose or Business Critical). <br/>
4645
47-
## Azure CLI Script to Enable Autoscale IOPS
48-
49-
> [!NOTE]
50-
> The script below will execute: <br/>
51-
> - Using Python 3.13.3 <br/>
52-
> - Checks if Azure CLI is available at the specified path. <br/>
53-
> - Lists all MySQL Flexible Servers. <br/>
54-
> - Tries to get each server’s resource group. <br/>
55-
> - If the resource group is missing, it prompts you to enter it. <br/>
56-
> - Asks for confirmation before enabling autoscale IOPS. <br/>
57-
58-
```python
59-
import subprocess
60-
import json
61-
62-
# Step 1: Get list of MySQL Flexible Servers
63-
servers_output = subprocess.check_output(
64-
["az", "mysql", "flexible-server", "list", "--query", "[].name", "-o", "tsv"],
65-
text=True
66-
)
67-
servers = servers_output.strip().splitlines()
68-
69-
# Step 2: Loop through each server and enable autoscale IOPS
70-
for server in servers:
71-
# Get the resource group for the server
72-
rg_output = subprocess.check_output(
73-
["az", "mysql", "flexible-server", "show", "--name", server, "--query", "resourceGroup", "-o", "tsv"],
74-
text=True
75-
)
76-
resource_group = rg_output.strip()
77-
78-
print(f"Enabling autoscale IOPS for {server} in {resource_group}...")
79-
80-
# Update the server to enable autoscale IOPS
81-
subprocess.run([
82-
"az", "mysql", "flexible-server", "update",
83-
"--name", server,
84-
"--resource-group", resource_group,
85-
"--iops", "Auto"
86-
])
87-
```
46+
Review [the script](./enable_autoscale_iops.py), and download it to your local machine.
8847

8948
## How to execute it Azure CLI Script to Enable Autoscale IOPS
9049

@@ -96,7 +55,6 @@ for server in servers:
9655
9756
<img width="550" alt="image" src="https://github.com/user-attachments/assets/22aa763d-b358-441a-b5b9-aa0197ce680d" />
9857

99-
10058
<div align="center">
10159
<h3 style="color: #4CAF50;">Total Visitors</h3>
10260
<img src="https://profile-counter.glitch.me/brown9804/count.svg" alt="Visitor Count" style="border: 2px solid #4CAF50; border-radius: 5px; padding: 5px;"/>

0 commit comments

Comments
 (0)