Cloud Assert Blogs

Usage & Billing Update 7: Usage Collector Extends to C# and PowerShell

Usage & Billing Update 7: Usage Collector Extends to C# and PowerShell

Injecting non-WAP Usage details into billing pipeline using our C# based extensibility module

Author: Jaganathan Krishnamoorthy/Tuesday, November 10, 2015/Categories: Windows Azure Pack, Usage and Billing

Rate this article:

With the Update 7 release of Cloud Assert Usage & Billing solution for Windows Azure Pack, we are delighted to announce this key enhancement: C# and PowerShell based Usage Extensibility. You are no more limited with just the resources exposed by WAP (and especially System Center). You can now fill the gaps, add more meters and attach monetary values all with-in the awesome Usage and Billing solution from Cloud Assert for Windows Azure Pack.

For instance, many of our customers had requested for billing their Tenant's usage of System Center VM Networks, VPN and specifically VM Networks that have NAT enabled. System Center does not expose those Usage information currently, through the WAP pipeline, so there is no way to monetize or report on those imporant resource usage. Now with Cloud Assert Usage and Billing extensibility module, those details can be easily captured from System Center (via simple Powershell scripting) and injected into Cloud Assert Billing pipeline. (Sample Powershell scripts attached with this blog). 

Not just the usage from traditional WAP services, you can now get any Usage data from any source, like Domain and SSL usage or for the fun of it, say you sell lime juice, as long as you can write simple PowerShell or C# to retreive that lime juice usage - Cloud Assert Usage and Billing will observe those metrics you send through these simple extensibility mechanisms, aggregate the metrics, provide visibility via WAP Tenant portal to your end users, set price profiles, generate invoices etc., combined with all the other features available.

How it works:

1. Usage & Billing Agent Service reads the UsageExtensionsSettings.json on startup, and initializes the enabled extensions
2. Agent Service periodically invokes each extension. It gives the list of subscription ids or user ids to process, as input to the Extension, for a given hour
3. Agent Service persists the generated Usage Records into RawUsageRecords table
4. If there are any remaining IDs to be processed for that hour, step #2 is repeated
5. Agent Service Aggregators now take care of processing the RawUsageRecords into Hourly, Daily and Monthly records, according to Pricing Profile configuration

Instructions to setup our Extensibility module and scripts:

1.       Obtain the Usage Extensibility Module zip file from Cloud Assert

2.       Extract and copy the contents in to the deployment location of U&B Billing Agent Windows Service

a.   “C:\Program Files\CloudAssertBilling\CloudAssert.WAP.Billing.AgentService”

3.       Copy, rename and edit the systemcenter-vmnetwork-usage.ps1 to match with your Usage requirement

a.        The core functions in the Powershell script are ProcessSubscription and ProcessVMNetworkOfSubscription 

b.       Change the following lines to suit your needs:

4.       Edit the appropriate U&B Pricing Profile in WAP Admin portal and add as many Metered Resource Pricing entries to match the info provided in step #3.b (1 Metered Resource entry per Resource)

5.       Place the new Usage Powershell script created in step #3, in the Scripts folder

a.        Create the Scripts folder if it does not exist

6.       Edit the UsageExtensionsSettings.json file to add a new extension to the pipeline

a.        Change the Id, Name, Script Path and PSModulesToImport properties

b.       Use double slashes in place of single slash

7.       Edit the following lines CloudAssert.WAP.Billing.AgentService.exe.config file:

8.       Restart the U&B Billing Agent Service

9.       Check the CloudAssertBilling Windows Event Log for any errors

10.    If all looks good, check the RawUsageRecords table in CloudAssertBilling Database to see if the new Usage Records come in:

11.    If the Pricing Profile is configured is configured appropriately, then Usage will show up in Admin Portal in around 10 mins (once the scheduled Aggregators run in Agent Service).


Number of views (9043)/Comments (9)

9 comments on article "Usage & Billing Update 7: Usage Collector Extends to C# and PowerShell"

Avatar image


9/17/2018 2:12 AM

I don’t know why but it is not showing the updated version of cloud at my system. Do you please help me with this, as I don’t know the main issue. Here I have attached the details for your reference.

Avatar image


10/29/2018 5:21 AM

I this looks like a lot of efforts have been displayed here lately it feels so good that such details are being presented in such good light it is an amazing work being shown altogether

Avatar image


11/5/2018 9:27 PM

This blog is really written on a very helpful topic.Microsoft says the Windows Azure Pack comprises a numeral of capabilities that can be additional in to an organization's data center.

Avatar image

Garry Adams

12/2/2018 1:15 AM

Great survey. I'm sure you're getting a great response.

Avatar image


5/25/2019 11:25 PM

consider this writing service as the best helper when you are going to write case brief or any other academical paper.

Leave a comment

This form collects your name, email, IP address and content so that we can keep track of the comments placed on the website. For more info check our Privacy Policy and Terms Of Use where you will get more info on where, how and why we store your data.
Add comment