Azure Stack Hub Billing
Cloud Assert HomeDocs Home
2105.2
2105.2
  • Introduction
  • Release Notes
  • Features
    • Cost Management Across Multiple Azure Stack Hub Stamps
      • Connecting to an Azure AD Stamp
      • Connecting to an ADFS Stamp
    • Admin Features
      • Settings
      • Pricing Profile
        • Manage Pricing Profiles
      • Usage History
      • Invoice
      • Quotas
      • Credits
        • User Credits
      • Usage & Quota
      • Notifications
      • Health Status
      • Billing Subscriptions
      • Enabling End Users To View Usage Costs And Quota Consumption For Subscriptions Across Stamps
    • Tenant Features
      • Overview
      • Usage History
      • Invoice
      • Notifications
      • Usage and Quota
      • Billing Profile Creation
      • Manage Subscriptions
  • Installation
    • Prerequisites
      • PKI Certificate Requirements
      • Azure Stack Certification Authority certificate
    • Deployment
      • Install Billing Resource Provider
        • High Availability and Scale Deployment considerations
      • Operations and Monitoring
      • Billing Database and Log File Configuration
      • License Activation
      • Update VConnect Resource Provider With Billing Details
    • Configuration
      • Setup pricing profile and quotas
      • Invoice
      • Add Billing service to Azure Stack Plan
      • Add the resource provider in Tenant Portal
      • Mapping Subscriptions
      • Billing Tool Command Reference
    • Version Update
    • Remove Resource Provider
Powered by GitBook
On this page
  • Updating Billing Database
  • Monitor Billing Agent Health
  • Collecting Logs
  • Protect Config Files
  • Unprotect Config Files
  • Create Azure Stack Hub Stamp Connection
  • Update VConnect API Credentials

Was this helpful?

  1. Installation
  2. Configuration

Billing Tool Command Reference

PreviousMapping SubscriptionsNextVersion Update

Last updated 3 years ago

Was this helpful?

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.

Example:
.\Billing.exe CollectAllLogs /days:5 /ApiEndpoint:https://localhost:44306 /Username:admin /Password:p@ssword
  • 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.

.\Billing.exe CollectAllLogs /days:<int>

Example:
.\Billing.exe CollectAllLogs

Protect Config Files

The command will encrypt the config files.

.\Billing.exe SecureConfig "<file path>"

Example:
.\Billing.exe SecureConfig "C:\inetpub\MgmtSvc-CloudAssertBilling\Web.config"

Unprotect Config Files

the command will decrypt the config files.

.\Billing.exe UnSecureConfig "<file path>"

Example:
.\Billing.exe UnSecureConfig "C:\inetpub\MgmtSvc-CloudAssertBilling\Web.config"

Create Azure Stack Hub Stamp Connection

Connection with App Secret

.\Billing.exe CreateAzureStackConnection <connectionName> <adminSubscriptionId> <tenantId> <applicaionId> <adminArmEndpoint> <tokenRequestResourceUrl> <authorityEndpointUrl> [/applicationSecret:<String>]              

Example:
.\Billing.exe CreateAzureStackConnection "Azs-Hub-01" "eeea58bf-9184-4b9a-8299-66c89a91f78c" "1e3cf5be-16b5-4c3c-9ca7-98a0074854a0" "c5543be6-78a3-4498-9b1d-2e225d6b2856" "https://adminmanagement.local.azurestack.external" "https://adminmanagement.cloudassertrp.onmicrosoft.com/b96b9a53-b9a0-4d73-a7fc-f8e27b1b53d5" "https://login.microsoftonline.com" /applicationSecret:"k+amxQUyMqXWN2Ug==" 

Connection with Certificate Thumbprint

.\Billing.exe CreateAzureStackConnection <connectionName> <adminSubscriptionId> <tenantId> <applicaionId> <adminArmEndpoint> <tokenRequestResourceUrl> <authorityEndpointUrl> [/certificateThumbprint:<String>] [/isAdfs]

Example:
.\Billing.exe CreateAzureStackConnection "Azs-Hub-02" "a7960fbc-a502-452a-8865-dcec48d20ed1" "cc4aa06d-3177-457a-a4b4-a4f8d4a5aa2d" "30fe4a8c-7eb6-4511-889d-8703fb3189e2" "https://adminmanagement.local.azurestack.external" "https://adminmanagement.adfs.azurestack.local/30fe4a8c-7eb6-4511-889d-8703fb3189e2" "https://adfs.local.mas500.samm.corp.cloudassert.com/adfs/" /certificateThumbprint:"39ae733bf3ba4fb7b4199d91b4103ea2316fd470" True

Update VConnect API Credentials

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.

.\Billing.exe AddOrUpdateVConnectApiSettings <vconnectApiUrl> <vconnectApiUser> <vconnectApiPassword>

Example:
.\Billing.exe AddOrUpdateVConnectApiSettings "https://vconnect.cloudassert.local.azurestack.external:44305" "cloudassertadminuser" "p@ssword"

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 '' to get the necessary inputs to create the connection.

Cost Management Across Multiple Azure Stack Hub Stamps
Billing API Credentials in Billing.exe.config file
Billing database connection string in 'C:\inetpub\MgmtSvc-CloudAssertBilling\Web.config'' file.
Billing Agent Health
Log Collection for Troubleshooting Billing Resource Provider