Set-CmAzTag

Set tags on resources.

Sets mandatory and custom tags on either specific resources or all the resources in a resource group.

This command is part of the common command tooling.

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
Set-CmAzTag -SettingsFile "c:/directory/settingsFile.yml"

Example 2

1
Set-CmAzTag -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.

ResourceIds

resourceIds [array | null]

List of ids for existing resources for which to apply tagging.

ResourceGroupIds

resourceGroupIds [array | null]

List of ids for existing resource groups for which to apply tagging.

Tags

tags [object] Mandatory

Contains details required to deploy tagging.

Mandatory

mandatory [object]

Contains details required to deploy mandatory tagging.

Cm-Owner

cm-owner [string]

The contact details of an individual or group who is responsible for management of the resource, including escalating issues to the relevant department.

Cm-Charge

cm-charge [string]

Tags a resource with a cost center for billing management.

Cm-Apps

cm-apps [string]

Tags a resource with names of the application(s) that it supports.

Custom

custom [object | null]

Contains details required to deploy custom optional tagging.

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
{
  "component": "string",
  "resourceIds": [
    "string"
  ],
  "resourceGroupIds": [
    "string"
  ],
  "tags": {
    "mandatory": {
      "cm-owner": "string",
      "cm-charge": "string",
      "cm-apps": "string"
    },
    "custom": {

    }
  }
}
1
2
3
4
5
6
7
8
9
10
11
component: "string"    # Optional
resourceIds:     # Optional
  - "string"
resourceGroupIds:     # Optional
  - "string"
tags:     # Mandatory
  mandatory:     # Mandatory
    cm-owner: "string"    # Mandatory
    cm-charge: "string"    # Mandatory
    cm-apps: "string"    # Mandatory
  custom:     # Optional