The Billing tool commands are handy commands that interacts will the Billing API service and Billing database to perform operations and to get different reports.
The Billing tool is usually found inside the update bundle that is shared during every release. To run the billing commands, navigate inside the 'BillingTool' folder, open an elevated PS window and execute the desired commands. The commands can be run in two ways.
By passing the Billing API credentials as command parameters.
Saving the Billing API credentials once in the tool config file (Billing.exe.config) and running the command alone.
Example:
.\Billing.exe CollectAllLogs /days:5
Updating Billing Database
The command enables updating the Billing database. Before running the command, it would be good to ensure that the Billing database connection string is specified in 'C:\inetpub\MgmtSvc-CloudAssertBilling\Web.config' file.
.\Billing.exe UpdateDatabase
Monitor Billing Agent Health
The command gives the health of Billing Agent service.
.\Billing.exe GetUsageAggregationStatus
Collecting Logs
The command collects all necessary logs and compresses it to a zip file. Passing the optional parameter '/days:' will collect the recent logs for the duration specified number of days. If the '/days' parameter is not specified, the tool will collect all the available billing logs.
The command helps in creating a connection to Azure Stack Hub stamp so that the Cloud Assert Billing solution can query usage and compute cost for the same. The connection can be created either using azure app secret (AAD Integrated System) or certificate thumbprint (ADFS Integrated System). Refer 'Cost Management Across Multiple Azure Stack Hub Stamps' to get the necessary inputs to create the connection.
The command save the VConnect API credentials in the Billing 'AppSettings' table. These credentials will be used to query VConnect usage, create tenant Azure Stack Hub connections, etc.