New-CmAzMonitorResourceHealthAlerts

Allows definition and deployment of resource health alerts.

Deploys resource health alert rule at subscription, resource group or resource scope, which in turn are linked to specified action groups.

This command forms part of the Monitor 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-CmAzMonitorResourceHealthAlerts -SettingsFile "c:\directory\settingsFile.yml" -Confirm:$false

Example 2

1
New-CmAzMonitorResourceHealthAlerts -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] Mandatory

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

location

location [string | null]

Deployment location which is also used for created dedicated resource group if required.

Service

service [object]

Contains dependency and publish details for service location.

Dependencies

dependencies [object]

Contains dependency details for service location.

Action Groups

actionGroups [array | null]

Global default dependency value to fetch existing resource type.

ResourceGroup

resourceGroup [string | null]

Dependency value to fetch existing resource type.

Publish

publish [object | null]

Contains publish details for service location.

Resource Health Alert

resourceHealthAlert [string | null]

Global default value to publish on deployed resource type.

ResourceGroup

resourceGroup [string | null]

Global default value to publish on deployed resource type.

Groups

alerts [array] Mandatory

Contains all details pertaining to logical groupings of alert sets.

Name

name []

Becomes part of activity log alert rule generated name.

Description

description [string | null]

Description of the activity log alert rule.

Enabled

enabled [boolean | null]

If the alert rule is enabled or not.

Default:true

EventTypes

eventStatus [array | null]

Event Status to report on.

EventTypes

reasonType [array | null]

Event Status to report on.

ResourceTypes

resourceTypes [array | null]

Event Status to report on.

Health Status

healthStatus [object | null]

Contains current and previous health details resource to report on.

Current

current [array | null]

Current health status.

Previous

previous [array | null]

Previous health status.

Service

service [object | null]

Contains dependency and publish details for service location.

Dependencies

dependencies [object | null]

Contains dependency details for service location.

Action Groups

actionGroups [array | null]

Local overriding dependency value to fetch existing resource type.

TargetResources

targetResources [array | null]

Service tag value to fetch existing resources of which to apply the metric alert rule.

TargetResourceGroups

targetResourceGroups [array | null]

Service tag value to fetch existing resource groups of which to apply the metric alert rule.

Publish

publish [object | null]

Contains publish details for service location.

Resource Health Alert

resourceHealthAlert [string | null]

Local overriding value to publish on deployed 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
  "component": "string",
  "location": "string",
  "service": {
    "dependencies": {
      "actionGroups": [

      ],
      "resourceGroup": "string"
    },
    "publish": {
      "resourceHealthAlert": "string",
      "resourceGroup": "string"
    }
  },
  "alerts": [
    {
      "name": "unknown",
      "description": "string",
      "enabled": "true",
      "eventStatus": [

      ],
      "reasonType": [

      ],
      "resourceTypes": [

      ],
      "healthStatus": {
        "current": [

        ],
        "previous": [

        ]
      },
      "service": {
        "dependencies": {
          "actionGroups": [

          ],
          "targetResources": [

          ],
          "targetResourceGroups": [

          ]
        },
        "publish": {
          "resourceHealthAlert": "string"
        }
      }
    }
  ]
}
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
component: "string"    # Mandatory
location: "string"    # Optional
service:     # Optional
  dependencies:     # Optional
    actionGroups:     # Optional
      -     resourceGroup: "string"    # Optional
  publish:     # Optional
    resourceHealthAlert: "string"    # Optional
    resourceGroup: "string"    # Optional
alerts:     # Mandatory
  - name: "unknown"    # Optional
    description: "string"    # Optional
    enabled: "true"    # Optional
    eventStatus:     # Optional
      -     reasonType:     # Optional
      -     resourceTypes:     # Optional
      -     healthStatus:     # Optional
      current:     # Optional
        -       previous:     # Optional
        -     service:     # Optional
      dependencies:     # Optional
        actionGroups:     # Optional
          -         targetResources:     # Optional
          -         targetResourceGroups:     # Optional
          -       publish:     # Optional
        resourceHealthAlert: "string"    # Optional