Skip to main content

az-scout plugin for Microsoft Fabric capacity pricing

Project description

az-scout-plugin-fabric-price

An az-scout plugin that surfaces Microsoft Fabric capacity pricing — PAYG, 1-Year RI, and 3-Year RI — directly inside the az-scout UI, REST API, and MCP server.

Data is sourced from the az-scout-bdd-api pricing database and enriched with per-SKU costs using the Fabric CU (Capacity Unit) mapping.

Features

  • UI tab — interactive pricing table with region/currency selectors, per-SKU hourly & monthly costs, savings percentages, and per-CU-hour summary cards
  • 3 REST endpoints — capacities list, latest prices, and price time series
  • 3 MCP toolsfabric_capacities, fabric_prices_latest, fabric_price_series
  • Dark/light theme support via CSS custom properties
  • In-memory TTL cache (configurable via FABRIC_PRICE_CACHE_TTL env var, default 300 s)

Prerequisites

Installation

uv pip install -e .     # development
# or
uv pip install az-scout-plugin-fabric-price  # from PyPI

The plugin is auto-discovered at startup — no extra configuration needed.

Configuration

This plugin reuses the BDD-SKU plugin's API URL. Set it via any of:

  1. BDD-SKU Settings UIPUT /plugins/bdd-sku/settings
  2. Environment variableBDD_SKU_API_URL
  3. TOML config~/.config/az-scout/bdd-sku.toml[api] base_url = "…"

Cache TTL can be overridden:

export FABRIC_PRICE_CACHE_TTL=600  # seconds

REST API

All endpoints are mounted at /plugins/fabric-price/.

GET /v1/fabric/capacities

Static list of Fabric SKUs and CU counts.

curl http://localhost:5001/plugins/fabric-price/v1/fabric/capacities

GET /v1/fabric/prices/latest

Latest per-CU-hour and per-SKU pricing for a region.

Parameter Required Default Description
region yes Azure region name
currency no USD ISO 4217 currency code
curl "http://localhost:5001/plugins/fabric-price/v1/fabric/prices/latest?region=eastus&currency=EUR"

GET /v1/fabric/prices/series

Price time series for a specific SKU.

Parameter Required Default Description
region yes Azure region name
sku yes Fabric SKU (F2, F4, … F2048)
model no PAYG Pricing model: PAYG, RI_1Y, RI_3Y
currency no USD ISO 4217 currency code
from no Start date (ISO 8601)
to no End date (ISO 8601)
bucket no day Time bucket: day, week, month
curl "http://localhost:5001/plugins/fabric-price/v1/fabric/prices/series?region=eastus&sku=F64&bucket=week"

MCP tools

Tool Parameters Description
fabric_capacities List all Fabric SKUs and their CU counts
fabric_prices_latest region, currency? Latest pricing (per-CU-hour + per-SKU)
fabric_price_series region, sku, model?, currency?, from_dt?, to_dt?, bucket? Price time series for a SKU

Project structure

az-scout-plugin-fabric-price/
├── pyproject.toml
├── README.md
└── src/
    └── az_scout_fabric_price/
        ├── __init__.py          # FabricPricePlugin class
        ├── bdd_client.py        # HTTP client → bdd-api server
        ├── models.py            # SKU_CU_MAP, classify_model, extract_per_cu_hour
        ├── routes.py            # FastAPI endpoints (3 routes)
        ├── service.py           # Business logic + caching
        ├── tools.py             # MCP tool functions (3 tools)
        └── static/
            ├── css/fabric-price.css
            ├── html/fabric-price-tab.html
            └── js/fabric-price-tab.js
tests/
    ├── test_models.py
    ├── test_routes.py
    └── test_service.py

Development

uv sync
uv run ruff check src/ tests/
uv run ruff format --check src/ tests/
uv run mypy src/
uv run pytest

Versioning

Version is derived from git tags via hatch-vcs. Tags follow CalVer: v2026.2.0.

How it works

  1. The plugin JS loads the HTML fragment into #plugin-tab-example.
  2. It watches #tenant-select and #region-select for changes.
  3. When both are set, it fetches subscriptions from /api/subscriptions.
  4. The user picks a subscription and clicks the button.
  5. The plugin calls GET /plugins/example/hello?subscription_name=…&tenant=…&region=….

Quality checks

The scaffold includes GitHub Actions workflows in .github/workflows/:

  • ci.yml — Runs lint (ruff + mypy) and tests (pytest) on Python 3.11–3.13, triggered on push/PR to main.
  • publish.yml — Builds, creates a GitHub Release, and publishes to PyPI via trusted publishing (OIDC). Triggered on version tags (v*). Requires a pypi environment configured in your repo settings with OIDC trusted publishing.

Run the same checks locally:

uv run ruff check src/ tests/
uv run ruff format --check src/ tests/
uv run mypy src/
uv run pytest

To publish a release:

git tag v2026.2.0
git push origin v2026.2.0

Copilot support

The .github/copilot-instructions.md file provides context to GitHub Copilot about the plugin structure, conventions, and az-scout plugin API. It helps Copilot generate code that follows the project patterns.

License

MIT

Disclaimer

This tool is not affiliated with Microsoft. All capacity, pricing, and latency information are indicative and not a guarantee of deployment success. Spot placement scores are probabilistic. Quota values and pricing are dynamic and may change between planning and actual deployment. Latency values are based on Microsoft published statistics and must be validated with in-tenant measurements.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

az_scout_plugin_fabric_price-2026.4.9.tar.gz (136.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file az_scout_plugin_fabric_price-2026.4.9.tar.gz.

File metadata

File hashes

Hashes for az_scout_plugin_fabric_price-2026.4.9.tar.gz
Algorithm Hash digest
SHA256 b67b798833e718e94e824edfdafd8aff13823430dfd9567ae7955f4c9b00488b
MD5 2561006148bbf0f629aa5689d60baeca
BLAKE2b-256 17706212016d4d5c14ea13dafd2dcbe7445cfefe4a4f1069653bff0cdd4b46af

See more details on using hashes here.

Provenance

The following attestation bundles were made for az_scout_plugin_fabric_price-2026.4.9.tar.gz:

Publisher: publish.yml on az-scout/az-scout-plugin-fabric-price

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file az_scout_plugin_fabric_price-2026.4.9-py3-none-any.whl.

File metadata

File hashes

Hashes for az_scout_plugin_fabric_price-2026.4.9-py3-none-any.whl
Algorithm Hash digest
SHA256 804f49ae62fc5ebe1b39c78c3077e00c3f75d74c4ade0501485859ba1bea0dea
MD5 afd20edd008500c4a322b688eedd741e
BLAKE2b-256 4ca49260c3fbb940af5fb371baa80b432b06a6acaa25f3753a781c0dbe3dae85

See more details on using hashes here.

Provenance

The following attestation bundles were made for az_scout_plugin_fabric_price-2026.4.9-py3-none-any.whl:

Publisher: publish.yml on az-scout/az-scout-plugin-fabric-price

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page