How to pull pricing & billing information

Hello there,

I want to pull the pricing and billing information on the resources I use in my Azure subscription(s) under my Azure account. I want to query this and store in my database. I want to also identify the date time of the VM when it is deleted. Is there any API in Azure or any PowerShell commands available to achieve this?

January 29th, 2015 10:53pm

hi sir,

Currently, Azure don't have API or powershell to query the resource cost . I suggest you can vote the feature request on this page:

http://feedback.azure.com/forums/170030-billing/suggestions/1143971-billing-usage-api

Regards,
Will

Free Windows Admin Tool Kit Click here and download it now
January 30th, 2015 12:49pm

@MrNani, there are Azure Billing APIs now available for your use- Azure Usage and Azure RateCard API:

Azure Cloud Cover Episode on Azure Billing APIs

https://channel9.msdn.com/Shows/Cloud+Cover/Episode182-Usage-and-RateCard-APIs-with-Moinak-Bandyopadhyay

High-level article describing the IT Financial Management scenario with Azure Billing APIs

https://azure.microsoft.com/en-us/documentation/articles/billing-usage-rate-card-overview/

ScottGu's blog post describing the Azure Billing APIs

https://weblogs.asp.net/scottgu/new-azure-billing-apis-available

Partner Solution 1: Cloudyn

https://azure.microsoft.com/en-us/documentation/articles/billing-usage-rate-card-partner-solution-cloudyn/

Partner Solution 2: Cloud Cruiser

https://azure.microsoft.com/en-us/documentation/articles/billing-usage-rate-card-partner-solution-cloudcruiser/

Azure BillingCodeSamples GitHub Repo (C# samples)

https://github.com/Azure/BillingCodeSamples

Usage REST API Reference on MSDN

https://msdn.microsoft.com/library/azure/1ea5b323-54bb-423d-916f-190de96c6a3c

RateCard REST API Reference on MSDN

https://msdn.microsoft.com/library/azure/1ea5b323-54bb-423d-916f-190de96c6a3c

Find your OfferDurableID to call the RateCard API

https://account.windowsazure.com/Subscriptions -> Select subscription -> Bottom right corner

Find all OfferDurable IDs to get rates from RateCard APi

http://azure.microsoft.com/en-us/support/legal/offer-details/

 

MS-AZR- + OfferNumber from the table.

Powershell Commandlet

get-UsageAggregates

 

Switch-AzureMode -Name AzureResourceManager

Add-AzureAccount

Select-AzureSubscription -SubscriptionId 'YOUR-AZURE-SUB-ID'

$aggregate= get-UsageAggregates -ReportedStartTime "6/1/2015" -ReportedEndTime "6/18/2015"

$aggregate

 

 

Nuget package

https://www.nuget.org/packages/Microsoft.Azure.Commerce.UsageAggregates/

CLI

Once you install CLI, follow these steps:

 

Azure login 'YOUR-IDENTITY'

Azure account set 'YOUR-SUBSCRIPTION-NAME'

Azure config mode arm

Azure  usage list --reportedStartTime 5/1/2015 --reportedEndTime 5/4/2015 (You can configure your own datetime)

September 9th, 2015 2:55pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics