diff --git a/.github/.markdownlint.json b/.github/.markdownlint.json new file mode 100644 index 0000000..97a16cc --- /dev/null +++ b/.github/.markdownlint.json @@ -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 +} diff --git a/.github/workflows/update-md-date.yml b/.github/workflows/update-md-date.yml new file mode 100644 index 0000000..96dc9d7 --- /dev/null +++ b/.github/workflows/update-md-date.yml @@ -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 }} diff --git a/.github/workflows/update_date.py b/.github/workflows/update_date.py new file mode 100644 index 0000000..ab86df5 --- /dev/null +++ b/.github/workflows/update_date.py @@ -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']) diff --git a/.github/workflows/validate_and_fix_markdown.yml b/.github/workflows/validate_and_fix_markdown.yml new file mode 100644 index 0000000..cd98f3c --- /dev/null +++ b/.github/workflows/validate_and_fix_markdown.yml @@ -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 }} diff --git a/README.md b/README.md index 32928cd..0410d29 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,6 @@ Last updated: 2025-05-13 -
Table of Content (Click to expand) @@ -32,6 +31,7 @@ Last updated: 2025-05-13
> 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.
+> > - During `high demand`, the system `increases IOPS` to maintain performance. > - During `low demand`, it `scales down` to reduce resource usage and cost. @@ -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 + ## How to enable IOPS (manual approach) @@ -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 + ## How to enable IOPS (script) @@ -67,7 +67,7 @@ Last updated: 2025-05-13 image - - Choose the ` Storage IO` metric (both percent and count). + - Choose the `Storage IO` metric (both percent and count). image @@ -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 - +

Total Visitors

Visitor Count
- diff --git a/autoscaleMultiple-IOPS/README.md b/autoscaleMultiple-IOPS/README.md index d56650c..1e53fcf 100644 --- a/autoscaleMultiple-IOPS/README.md +++ b/autoscaleMultiple-IOPS/README.md @@ -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`. @@ -23,13 +23,14 @@ Last updated: 2025-05-13 image -- [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). image ## By Resource Group > Overall process:
(./scripts/enable_autoscale_iops_byRG.py) +> > - 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**.
@@ -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:
+> > - 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).