$npx -y skills add github/awesome-copilot --skill azure-pricingFetches real-time Azure retail pricing using the Azure Retail Prices API (prices.azure.com) and estimates Copilot Studio agent credit consumption. Use when the user asks about the cost of any Azure service, wants to compare SKU prices, needs pricing data for a cost estimate, ment
| 1 | # Azure Pricing Skill |
| 2 | |
| 3 | Use this skill to retrieve real-time Azure retail pricing data from the public Azure Retail Prices API. No authentication is required. |
| 4 | |
| 5 | ## When to Use This Skill |
| 6 | |
| 7 | - User asks about the cost of an Azure service (e.g., "How much does a D4s v5 VM cost?") |
| 8 | - User wants to compare pricing across regions or SKUs |
| 9 | - User needs a cost estimate for a workload or architecture |
| 10 | - User mentions Azure pricing, Azure costs, or Azure billing |
| 11 | - User asks about reserved instance vs. pay-as-you-go pricing |
| 12 | - User wants to know about savings plans or spot pricing |
| 13 | |
| 14 | ## API Endpoint |
| 15 | |
| 16 | ``` |
| 17 | GET https://prices.azure.com/api/retail/prices?api-version=2023-01-01-preview |
| 18 | ``` |
| 19 | |
| 20 | Append `$filter` as a query parameter using OData filter syntax. Always use `api-version=2023-01-01-preview` to ensure savings plan data is included. |
| 21 | |
| 22 | ## Step-by-step Instructions |
| 23 | |
| 24 | If anything is unclear about the user's request, ask clarifying questions to identify the correct filter fields and values before calling the API. |
| 25 | |
| 26 | 1. **Identify filter fields** from the user's request (service name, region, SKU, price type). |
| 27 | 2. **Resolve the region**: the API requires `armRegionName` values in lowercase with no spaces (e.g. "East US" → `eastus`, "West Europe" → `westeurope`, "Southeast Asia" → `southeastasia`). See [references/REGIONS.md](references/REGIONS.md) for a complete list. |
| 28 | 3. **Build the filter string** using the fields below and fetch the URL. |
| 29 | 4. **Parse the `Items` array** from the JSON response. Each item contains price and metadata. |
| 30 | 5. **Follow pagination** via `NextPageLink` if you need more than the first 1000 results (rarely needed). |
| 31 | 6. **Calculate cost estimates** using the formulas in [references/COST-ESTIMATOR.md](references/COST-ESTIMATOR.md) to produce monthly/annual estimates. |
| 32 | 7. **Present results** in a clear summary table with service, SKU, region, unit price, and monthly/annual estimates. |
| 33 | |
| 34 | ## Filterable Fields |
| 35 | |
| 36 | | Field | Type | Example | |
| 37 | |---|---|---| |
| 38 | | `serviceName` | string (exact, case-sensitive) | `'Functions'`, `'Virtual Machines'`, `'Storage'` | |
| 39 | | `serviceFamily` | string (exact, case-sensitive) | `'Compute'`, `'Storage'`, `'Databases'`, `'AI + Machine Learning'` | |
| 40 | | `armRegionName` | string (exact, lowercase) | `'eastus'`, `'westeurope'`, `'southeastasia'` | |
| 41 | | `armSkuName` | string (exact) | `'Standard_D4s_v5'`, `'Standard_LRS'` | |
| 42 | | `skuName` | string (contains supported) | `'D4s v5'` | |
| 43 | | `priceType` | string | `'Consumption'`, `'Reservation'`, `'DevTestConsumption'` | |
| 44 | | `meterName` | string (contains supported) | `'Spot'` | |
| 45 | |
| 46 | Use `eq` for equality, `and` to combine, and `contains(field, 'value')` for partial matches. |
| 47 | |
| 48 | ## Example Filter Strings |
| 49 | |
| 50 | ``` |
| 51 | # All consumption prices for Functions in East US |
| 52 | serviceName eq 'Functions' and armRegionName eq 'eastus' and priceType eq 'Consumption' |
| 53 | |
| 54 | # D4s v5 VMs in West Europe (consumption only) |
| 55 | armSkuName eq 'Standard_D4s_v5' and armRegionName eq 'westeurope' and priceType eq 'Consumption' |
| 56 | |
| 57 | # All storage prices in a region |
| 58 | serviceName eq 'Storage' and armRegionName eq 'eastus' |
| 59 | |
| 60 | # Spot pricing for a specific SKU |
| 61 | armSkuName eq 'Standard_D4s_v5' and contains(meterName, 'Spot') and armRegionName eq 'eastus' |
| 62 | |
| 63 | # 1-year reservation pricing |
| 64 | serviceName eq 'Virtual Machines' and priceType eq 'Reservation' and armRegionName eq 'eastus' |
| 65 | |
| 66 | # Azure AI / OpenAI pricing (now under Foundry Models) |
| 67 | serviceName eq 'Foundry Models' and armRegionName eq 'eastus' and priceType eq 'Consumption' |
| 68 | |
| 69 | # Azure Cosmos DB pricing |
| 70 | serviceName eq 'Azure Cosmos DB' and armRegionName eq 'eastus' and priceType eq 'Consumption' |
| 71 | ``` |
| 72 | |
| 73 | ## Full Example Fetch URL |
| 74 | |
| 75 | ``` |
| 76 | https://prices.azure.com/api/retail/prices?api-version=2023-01-01-preview&$filter=serviceName eq 'Functions' and armRegionName eq 'eastus' and priceType eq 'Consumption' |
| 77 | ``` |
| 78 | |
| 79 | URL-encode spaces as `%20` and quotes as `%27` when constructing the URL. |
| 80 | |
| 81 | ## Key Response Fields |
| 82 | |
| 83 | ```json |
| 84 | { |
| 85 | "Items": [ |
| 86 | { |
| 87 | "retailPrice": 0.000016, |
| 88 | "unitPrice": 0.000016, |
| 89 | "currencyCode": "USD", |
| 90 | "unitOfMeasure": "1 Execution", |
| 91 | "serviceName": "Functions", |
| 92 | "skuName": "Premium", |
| 93 | "armRegionName": "eastus", |
| 94 | "meterName": "vCPU Duration", |
| 95 | "productName": "Functions", |
| 96 | "priceType": "Consumption", |
| 97 | "isPrimaryMeterRegion": true, |