New-CmAzCoreBillingRule

Deploys a set of budgets at the subscription level.

Completes the following:

  • Deploys a set of budgets at the subscription level.
  • Applies filtering via tags (cm-charge: accountnumber) to budgets for resource targeting.
  • Sets the action group to be notified once the threshold for a budget is met.

This command forms part of the Core Building Block.

Parameters

-SettingsFile

Required. (String) File path for the settings file to be converted into a settings object.

-SettingsObject

Required. (Object) Object containing the configuration values required to run this cmdlet.

-WhatIf

(Switch) Run the command without executing any actions, so that no changes are made. The command will output a description of actions to be performed against the affected resources in the console window. Use this option if you are unsure of the overall impact of your command and wish to review it before committing to making changes.

-Confirm

(Switch) Run the command without executing any actions, so that no changes are made. The command will output a description of actions to be performed against the affected resources in the console window. Use this option if you are unsure of the overall impact of your command and wish to review it before committing to making changes.

Usage

Example 1

1
New-CmAzCoreBillingRule -SettingsFile "c:/directory/settingsFile.yml"

Example 2

1
New-CmAzCoreBillingRule -SettingsObject $settings

Settings

Beta documentation
The following schema documentation is automatically generated as part of a recent roadmap task. There may be inaccuracies or incomplete information while we flush out bugs; please refer to the packed project settings examples where necessary.

Settings Root.

Component

component [string | null]

Value to determine what cmdlet should be dynamically loaded for these settings.

Location

location [string] Mandatory

Deployment history location

Service

service [object | null]

Contains dependency and publish details for service location.

Dependencies

dependencies [object | null]

Contains dependency details for service location.

Actiongroup

actiongroup [string | null]

Global default dependency value to fetch existing resource type.

Budgets

budgets [array] Mandatory

All details required to deploy multiple budgets.

Name

name [string]

Becomes part of the generated budget's name.

Category

category [string]

Budget's category, highlights if the budget is marked as cost or usage

Valid values:"Cost" , "Usage" , "cost" , "usage"

AccountNumber

accountNumber [string]

Tag value (cm-charge) used for filtering resources in a budget.

TimeGrain

timeGrain [string]

The budget's tracking interval.

Valid values:"Monthly" , "Quarterly" , "Annually" , "monthly" , "quarterly" , "annually"

Amount

amount [integer]

Total cost to track within the budget.

The startDate schema

startDate [string | null]

Budget's start date. Must follow date format.

The endDate schema

endDate [string | null]

Budget's end date. Must follow date format.

Thresholds

thresholds [array]

Alert thresholds for the budget.

Service

service [object | null]

Contains dependency and publish details for service location.

Dependencies

dependencies [object | null]

Contains publish details for service location.

Actiongroup

actiongroup [string | null]

Local overriding dependency value to fetch existing resource type.

Examples

The following example files are automatically generated from the settings file schema definition to show how the specification can be used in practise. Cloudmarque can accept both JSON and YAML parameter files.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
  "component": "string",
  "location": "string",
  "service": {
    "dependencies": {
      "actiongroup": "string"
    }
  },
  "budgets": [
    {
      "name": "string",
      "category": "Cost",
      "accountNumber": "string",
      "timeGrain": "Monthly",
      "amount": 0,
      "startDate": "string",
      "endDate": "string",
      "thresholds": [
        0
      ],
      "service": {
        "dependencies": {
          "actiongroup": "string"
        }
      }
    }
  ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
component: "string"    # Optional
location: "string"    # Mandatory
service:     # Optional
  dependencies:     # Optional
    actiongroup: "string"    # Optional
budgets:     # Mandatory
  - name: "string"    # Mandatory
    category: "Cost"    # Mandatory
    accountNumber: "string"    # Mandatory
    timeGrain: "Monthly"    # Mandatory
    amount: 0    # Mandatory
    startDate: "string"    # Optional
    endDate: "string"    # Optional
    thresholds:     # Mandatory
      - 0
    service:     # Optional
      dependencies:     # Optional
        actiongroup: "string"    # Optional