New-CmAzCoreAutomation

Create an Automation account with runbooks.

Completes the following:

  • Creates Resource Group for runbook, dsc or both.
  • Creates Automation account for runbook, dsc or both.
  • Creates Key vault certificate if not available.
  • Create RunAsAccount and RunAsCertificate for Automation accounts.
  • Optionally sync code repository (tvfc git github).
  • Optionally create private endpoint integrated with private zone.

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.

-TagSettingsFile

Required. (String) File path for settings containing tags definition.

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

Example 2

1
New-CmAzCoreAutomation -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

Automation account deployment location.

Name

name [string] Mandatory

Becomes part of the generated automation account name.

Service

service [object] Mandatory

Contains dependency and publish details for service location.

Dependencies

dependencies [object]

Contains dependency details for service location.

Keyvault

keyvault [string]

Dependency value to fetch existing resource type.

Workspace

workspace [string]

Dependency value to fetch existing resource type.

Vnet

vnet [string | null]

Global default dependency value to fetch existing resource type.

PrivateZones

privateZones [array | null]

Dependency value to fetch existing resource type. Enables private zone integration.

Publish

publish [object]

Contains publish details for service location.

ResourceGroup

resourceGroup [string]

Value to publish on deployed resource type.

Automation

automation [string] Mandatory

Value to publish on deployed resource type.

PrivateEndpoint

privateEndpoint [string | null]

Global default value to publish on deployed resource type.

Automation

automation [object] Mandatory

Contains details required to deploy an Automation Account.

CertificateName

certificateName [string | null]

Name of certificate in an existing key vault.

CertificateSecretName

certificateSecretName [string]

Name of certificate secret in an existing key vault.

SourceControl

sourceControl [object | null]

Container for an existing repo in source control.

KeyVaultPersonalAccessToken

keyVaultPersonalAccessToken [string | null]

Secret name of PAT token in existing key vault to access repo.

Url

url [string | null]

Url of source control repo.

Type

type [string | null]

Type of repo e.g Github.

Default:github

Branch

branch [string | null]

Existing branch within repo.

Default:master

FolderPath

folderPath [string | null]

Directory path of Runbook or DSC files.

Default:/

PrivateEndpoints

privateEndpoints [array | null]

Container for private endpoint details.

SubnetName

subnetName [string]

Names of underlying sub-resources to create private connection with.

Name

name [string | null] Mandatory

Becomes part of private endpoint name.

SubResourceName

subResourceName [string]

Names of underlying sub-resources to create private connection with.

Valid values:"Webhook" , "DSCAndHybridWorker"

Service

service [object | null] Mandatory

Contains dependency and publish details for service location.

Dependencies

dependencies [object | null]

Contains dependency details for service location.

Vnet

vnet [string | null]

Local overriding dependency value to fetch existing resource type.

PrivateZones

privateZones [array | null]

Dependency value to fetch existing resource type. Enables private zone integration.

Publish

publish [object]

Contains publish details for service location.

PrivateEndpoint

privateEndpoint [string]

Local overriding value to publish on deployed 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
{
  "component": "string",
  "location": "string",
  "name": "string",
  "service": {
    "dependencies": {
      "keyvault": "string",
      "workspace": "string",
      "vnet": "string",
      "privateZones": [

      ]
    },
    "publish": {
      "resourceGroup": "string",
      "automation": "string",
      "privateEndpoint": "string"
    }
  },
  "automation": {
    "certificateName": "string",
    "certificateSecretName": "string",
    "sourceControl": {
      "keyVaultPersonalAccessToken": "string",
      "url": "string",
      "type": "github",
      "branch": "master",
      "folderPath": "/"
    },
    "privateEndpoints": [
      {
        "subnetName": "string",
        "name": "string",
        "subResourceName": "Webhook",
        "service": {
          "dependencies": {
            "vnet": "string",
            "privateZones": [

            ]
          },
          "publish": {
            "privateEndpoint": "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
27
28
29
30
31
32
component: "string"    # Optional
location: "string"    # Mandatory
name: "string"    # Mandatory
service:     # Mandatory
  dependencies:     # Mandatory
    keyvault: "string"    # Mandatory
    workspace: "string"    # Mandatory
    vnet: "string"    # Optional
    privateZones:     # Optional
      -   publish:     # Mandatory
    resourceGroup: "string"    # Mandatory
    automation: "string"    # Mandatory
    privateEndpoint: "string"    # Optional
automation:     # Mandatory
  certificateName: "string"    # Optional
  certificateSecretName: "string"    # Mandatory
  sourceControl:     # Optional
    keyVaultPersonalAccessToken: "string"    # Optional
    url: "string"    # Optional
    type: "github"    # Optional
    branch: "master"    # Optional
    folderPath: "/"    # Optional
  privateEndpoints:     # Optional
    - subnetName: "string"    # Mandatory
      name: "string"    # Optional
      subResourceName: "Webhook"    # Mandatory
      service:     # Optional
        dependencies:     # Optional
          vnet: "string"    # Optional
          privateZones:     # Optional
            -         publish:     # Optional
          privateEndpoint: "string"    # Optional