npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rawdash/connector-azure-cost

v0.27.0

Published

Rawdash connector for Azure Cost Management — pulls daily Azure spend (optionally grouped by resource group, service, or tag) into the six-shape storage model via the Cost Management query API

Downloads

1,180

Readme

@rawdash/connector-azure-cost

npm version license

Track daily Azure spend over time, optionally broken down by resource group, service, or tag, via the Cost Management query API.

Cost & frequency. Azure Cost Management queries are throttled aggressively per subscription; avoid syncing more often than necessary. Recommended sync interval: 1 day. Minimum sensible interval: 1 hour.

Install

npm install @rawdash/connector-azure-cost

Authentication

Authenticates with a Microsoft Entra ID (Azure AD) service principal (tenant ID + client ID + client secret) scoped to the target subscription. The principal needs the built-in Cost Management Reader role at the subscription scope (or Reader).

  1. In the Azure portal open Microsoft Entra ID → App registrations → New registration and create an app for rawdash.
  2. Under Certificates & secrets, generate a client secret and copy its value (it is only shown once).
  3. In the target subscription open Access control (IAM) → Add role assignment and grant the new service principal the built-in Cost Management Reader role.
  4. Store the client secret as a secret and reference it from config as clientSecret: secret("AZ_CLIENT_SECRET"), alongside tenantId, clientId, and subscriptionId.
  5. Cost Management must be enabled for the subscription; the first activation can take up to 24 hours before data is queryable.

Configuration

| Field | Type | Required | Description | | ---------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | tenantId | string | Yes | Microsoft Entra ID (Azure AD) tenant ID - the directory that hosts the app registration. | | clientId | string | Yes | Application (client) ID of the Entra ID app registration / service principal used for authentication. | | clientSecret | secret | Yes | Client secret of the Entra ID app registration. Generate one under App registrations → Certificates & secrets. | | subscriptionId | string | Yes | Azure subscription ID the cost query is scoped to. The service principal needs Cost Management Reader (or Reader) on this subscription. | | groupBy | array | No | Up to two Cost Management dimensions to break costs down by, e.g. ServiceName, ResourceGroup, or TAG:Environment. Omit for total cost only. | | lookbackDays | number | No | How many days of history to fetch on a full sync. Defaults to 90. |

Resources

  • azure_cost_daily (metric) - Daily Azure actual cost per time bucket, optionally split across the configured group-by dimensions.
    • Endpoint: POST /subscriptions/{subId}/providers/Microsoft.CostManagement/query
    • Unit: currency reported by Azure
    • Granularity: daily
    • Dimensions: unit, service_name
    • Cost data can be revised for a couple of days after the fact, so incremental syncs refetch a short trailing window. Cost Management accepts at most two grouping dimensions per query.

Example

import {
  defineConfig,
  defineDashboard,
  defineMetric,
  secret,
} from '@rawdash/core';

const azureCost = {
  name: 'azure-cost',
  connectorId: 'azure-cost',
  config: {
    tenantId: '00000000-0000-0000-0000-000000000000',
    clientId: '00000000-0000-0000-0000-000000000000',
    clientSecret: secret('AZ_CLIENT_SECRET'),
    subscriptionId: '00000000-0000-0000-0000-000000000000',
    groupBy: ['ServiceName'],
  },
};

export default defineConfig({
  connectors: [azureCost],
  dashboards: {
    finance: defineDashboard({
      widgets: {
        spend_30d: {
          kind: 'stat',
          title: 'Azure spend (30d)',
          window: '30d',
          metric: defineMetric({
            connector: azureCost,
            shape: 'metric',
            name: 'azure_cost_daily',
            fn: 'sum',
          }),
        },
      },
    }),
  },
});

Rate limits

Cost Management throttles via 429 responses with Retry-After; the shared HTTP client honors Retry-After and backs off on 429.

Limitations

  • Cost data can be revised for a couple of days after the fact, so incremental syncs refetch a short trailing window.
  • Daily granularity only (the most common dashboard slice). Monthly granularity is not exposed in v1.
  • At most two grouping dimensions are accepted per query (Cost Management limit).
  • Forecast (forecast endpoint) is not synced in v1; only historical actual cost.

Links

License

Apache-2.0