技能 产品商业 比较Azure服务区域价格

比较Azure服务区域价格

v20260428
azure-prices
该技能可利用Azure零售价格API,查询并比较各类Azure服务的实时定价。用户可以检查特定区域的成本,或跨多个地理区域比较同一服务,从而帮助用户找到最具成本效益的部署方案。
获取技能
213 次下载
概览

Azure Prices

Fetch and compare live Azure service pricing using the bundled scripts that call the Azure Retail Prices API.

Execution Rules

Always use the bundled npm script for price lookups and comparisons when terminal execution is available.

DO NOT call the Azure Retail Prices API directly. You can only use the script to call the API.

Scripts

All scripts live in ./scripts/ and run via npm:

# List sample service names (discover what's available)
npm run --prefix ./scripts get-prices

# Get prices for a service in a region (default region: eastus)
npm run --prefix ./scripts get-prices -- "Virtual Machines" eastus

The script accepts two positional arguments:

  1. Service name (required for price lookup) — e.g. "Virtual Machines", "SQL Database", "Storage", "Azure Cosmos DB"
  2. Region (optional, defaults to eastus) — e.g. eastus, westus2, westeurope, southeastasia

When called with no arguments, it prints a sample of available service names.

How to Use

The npm commands below are the preferred execution path for this skill and should be used instead of direct API calls whenever command execution is available.

Single region lookup

Run the script with the service name and region. Present results in a readable table.

Cross-region comparison

To compare prices across regions, run the script multiple times — once per region — then combine the results into a comparison table. For example, to compare Virtual Machines prices across three regions:

npm run --prefix ./scripts get-prices -- "Virtual Machines" eastus
npm run --prefix ./scripts get-prices -- "Virtual Machines" westus2
npm run --prefix ./scripts get-prices -- "Virtual Machines" westeurope

Then join the results by SKU name to show a side-by-side comparison table with columns for each region.

Finding the cheapest region

Run prices for the target service across several common regions and sort by price. Common Azure regions to compare:

  • eastus, eastus2, westus2, centralus (US)
  • westeurope, northeurope, uksouth (Europe)
  • southeastasia, eastasia, japaneast (Asia-Pacific)

Service discovery

If the user isn't sure of the exact service name, run the script with no arguments first to get a sample of available names, then use the closest match.

Fallback Behavior

If command execution is unavailable, use the local script implementation as the behavioral reference, then fall back to public pricing sources only as needed. In that case, explicitly tell the user that script execution was unavailable before presenting results.

Output Format

Present pricing results as markdown tables. For comparisons, use a format like:

SKU East US West US 2 West Europe
D2 v2 $0.10/hr $0.11/hr $0.12/hr
D4 v2 $0.20/hr $0.22/hr $0.24/hr

Highlight the cheapest option per row when doing comparisons. Include the currency and unit of measure.

信息
Category 产品商业
Name azure-prices
版本 v20260428
大小 37.39KB
更新时间 2026-05-10
语言