Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/.markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"default": true,
"MD005": false,
"MD009": false,
"MD013": false,
"MD028": false,
"MD029": false,
"MD033": false,
"MD048": false,
"MD040": false,
"MD041": false,
"MD045": false,
"MD046": false
}
41 changes: 41 additions & 0 deletions .github/workflows/update-md-date.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Update Last Modified Date

on:
pull_request:
branches:
- main

permissions:
contents: write

jobs:
update-date:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: pip install python-dateutil

- name: Configure Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"

- name: Update last modified date in Markdown files
run: python .github/workflows/update_date.py

- name: Commit changes
run: |
git add -A
git commit -m "Update last modified date in Markdown files" || echo "No changes to commit"
git push origin HEAD:${{ github.event.pull_request.head.ref }}
49 changes: 49 additions & 0 deletions .github/workflows/update_date.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import os
import subprocess
from datetime import datetime, timezone

# Get the list of modified files
result = subprocess.run(['git', 'diff', '--name-only', 'HEAD~1'], stdout=subprocess.PIPE)
modified_files = result.stdout.decode('utf-8').split()

# Debugging: Print the list of modified files
print("Modified files:", modified_files)

# Filter for Markdown files
modified_md_files = [f for f in modified_files if f.endswith('.md')]

# Debugging: Print the list of modified Markdown files
print("Modified Markdown files:", modified_md_files)

# Current date
current_date = datetime.now(timezone.utc).strftime('%Y-%m-%d')

# Function to update the last modified date in a file
def update_date_in_file(file_path):
with open(file_path, 'r') as file:
lines = file.readlines()

updated = False
with open(file_path, 'w') as file:
for line in lines:
if line.startswith('Last updated:'):
file.write(f'Last updated: {current_date}\n')
updated = True
else:
file.write(line)
if not updated:
file.write(f'\nLast updated: {current_date}\n')

# Check if there are any modified Markdown files
if not modified_md_files:
print("No modified Markdown files found.")
exit(0)

# Update the date in each modified Markdown file
for file_path in modified_md_files:
print(f"Updating file: {file_path}") # Debugging: Print the file being updated
update_date_in_file(file_path)

# Add and commit changes
subprocess.run(['git', 'add', '-A'])
subprocess.run(['git', 'commit', '-m', 'Update last modified date in Markdown files'])
44 changes: 44 additions & 0 deletions .github/workflows/validate_and_fix_markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Validate and Fix Markdown

on:
pull_request:
branches:
- main

permissions:
contents: write

jobs:
validate-and-fix-markdown:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install Markdown Linter
run: npm install -g markdownlint-cli

- name: Lint and Fix Markdown files
run: markdownlint '**/*.md' --fix --config .github/.markdownlint.json --ignore GPT-RAG_SolutionAccelerator/

- name: Configure Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"

- name: Commit changes
run: |
git fetch origin
git checkout -b ${{ github.event.pull_request.head.ref }} origin/${{ github.event.pull_request.head.ref }}
git add -A
git commit -m "Fix Markdown syntax issues" || echo "No changes to commit"
git pull --rebase origin ${{ github.event.pull_request.head.ref }} || echo "No rebase needed"
git push origin HEAD:${{ github.event.pull_request.head.ref }}
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Last updated: 2025-05-13

</details>


<details>
<summary><b>Table of Content</b> (Click to expand)</summary>

Expand All @@ -32,6 +31,7 @@ Last updated: 2025-05-13
</details>

> When Autoscale IOPS is enabled for Azure Database for MySQL (Flexible Server), the IOPS (Input/Output Operations Per Second) automatically scale both up and down based on your workload demands. <br/>
>
> - During `high demand`, the system `increases IOPS` to maintain performance.
> - During `low demand`, it `scales down` to reduce resource usage and cost.

Expand All @@ -43,7 +43,7 @@ Last updated: 2025-05-13
4. Choose your subscription, resource group, and server name.
5. Select the region, MySQL version, and workload type (e.g., Development, Production).

https://github.com/user-attachments/assets/5b500aea-538d-4ddb-88b6-e0717a2d0fbe
<https://github.com/user-attachments/assets/5b500aea-538d-4ddb-88b6-e0717a2d0fbe>

## How to enable IOPS (manual approach)

Expand All @@ -53,7 +53,7 @@ Last updated: 2025-05-13
4. In the IOPS section, select the option `Autoscale IOPS`
5. Click `Save` to apply the changes.

https://github.com/user-attachments/assets/9e2983b3-3839-4ad3-8ab8-ccbb698f3228
<https://github.com/user-attachments/assets/9e2983b3-3839-4ad3-8ab8-ccbb698f3228>

## How to enable IOPS (script)

Expand All @@ -67,7 +67,7 @@ Last updated: 2025-05-13

<img width="550" alt="image" src="https://github.com/user-attachments/assets/f08afb04-e271-4ac3-8594-e3e98a9bfd2e" />

- Choose the ` Storage IO` metric (both percent and count).
- Choose the `Storage IO` metric (both percent and count).

<img width="550" alt="image" src="https://github.com/user-attachments/assets/ca585f55-e943-413d-9477-f26c099a1e66" />

Expand All @@ -82,11 +82,9 @@ Last updated: 2025-05-13
- You can also monitor `IO utilization percentage` to see how close your server is to its current IOPS limit.
3. **Enable Alerts (Optional)**: You can set up `alerts` in Azure Monitor to notify you when IOPS usage crosses certain thresholds, which can help you track scaling events in real time.

https://github.com/user-attachments/assets/19b96128-e37f-40b4-8e23-8a5384bc6686

<https://github.com/user-attachments/assets/19b96128-e37f-40b4-8e23-8a5384bc6686>

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

6 changes: 4 additions & 2 deletions autoscaleMultiple-IOPS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Last updated: 2025-05-13
> Using [Python 3.7+](https://www.python.org/downloads/source/)

> [!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.
> 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`.
Expand All @@ -23,13 +23,14 @@ Last updated: 2025-05-13

<img width="550" alt="image" src="https://github.com/user-attachments/assets/fa74f47c-bef2-4ad3-8b0f-2ee50813c486" />

- [Install Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli).
- [Install Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli).

<img width="550" alt="image" src="https://github.com/user-attachments/assets/3f552ecc-8e07-453a-9655-8bb5a89e1791" />

## By Resource Group

> Overall process: <br/> (./scripts/enable_autoscale_iops_byRG.py)
>
> - Automatically retrieves your **Azure subscription ID** using the Azure CLI. <br/>
> - List all Resource Groups in current subscription ID. <br/>
> - Prompts you only for the **resource group name**. <br/>
Expand All @@ -45,6 +46,7 @@ Review [the script](./scripts/enable_autoscale_iops_byRG.py), and download it to
## Across a Subscription

> You can also enable autoscale IOPS across an entire subscription, it requires: <br/>
>
> - Listing all MySQL Flexible Servers in the subscription. <br/>
> - For each server, retrieving its resource group. <br/>
> - Applying the update if the server is in a supported tier (General Purpose or Business Critical). <br/>
Expand Down