https://github.com/plasne/azure-billing
Node.js project showing how to get to billing data in Azure.
https://github.com/plasne/azure-billing
azure billing-api nodejs
Last synced: 3 months ago
JSON representation
Node.js project showing how to get to billing data in Azure.
- Host: GitHub
- URL: https://github.com/plasne/azure-billing
- Owner: plasne
- Created: 2016-06-01T18:23:26.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-08-28T03:53:24.000Z (almost 8 years ago)
- Last Synced: 2025-01-11T11:35:38.437Z (over 1 year ago)
- Topics: azure, billing-api, nodejs
- Language: JavaScript
- Homepage:
- Size: 56.6 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Azure Billing
This pulls a rate card and the usage data from a subscription for a specified period of time. Note that not all subscription types (most notably enterprise subscriptions) are not supported by this API.
## Usage
1. Install Node.js and install dependencies (ie. npm install).
2. Install the Azure CLI 2.0.
3. Login using the Azure CLI.
4. Select the appropriate subscription using the Azure CLI.
5. Look in the Azure portal under "Subscriptions" to get the offer type of the subscription (this is not currently exposed by API).
6. Run the application.
Example:
```bash
az login
az account set --subscription 1111111-2222-3333-4444-555555555555
node billing --offer MS-AZR-0036P --from 2018-04-30 --to 2018-05-02
```
## Notes
* The parameters "offer", "from", and "to" are all required.
* A rate card can take several minutes to download so it is saved as ".rates" and then that saved file is used. You must delete it to pull new rates.
* The API queries the data set by when entries are reported but aggregates the data by when they were used. Due to this discrepency, this tool fetches data 1 day before and 2 days after you requested by report date and then filters to the usage dates.