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).

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.

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.

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:/

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
{
  "component": "string",
  "location": "string",
  "name": "string",
  "service": {
    "dependencies": {
      "keyvault": "string",
      "workspace": "string"
    },
    "publish": {
      "resourceGroup": "string",
      "automation": "string"
    }
  },
  "automation": {
    "certificateName": "string",
    "certificateSecretName": "string",
    "sourceControl": {
      "keyVaultPersonalAccessToken": "string",
      "url": "string",
      "type": "github",
      "branch": "master",
      "folderPath": "/"
    }
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
component: "string"    # Optional
location: "string"    # Mandatory
name: "string"    # Mandatory
service:     # Mandatory
  dependencies:     # Mandatory
    keyvault: "string"    # Mandatory
    workspace: "string"    # Mandatory
  publish:     # Mandatory
    resourceGroup: "string"    # Mandatory
    automation: "string"    # Mandatory
automation:     # Mandatory
  certificateName: "string"    # Optional
  certificateSecretName: "string"    # Mandatory
  sourceControl:     # Optional
    keyVaultPersonalAccessToken: "string"    # Optional
    url: "string"    # Optional
    type: "github"    # Optional
    branch: "master"    # Optional
    folderPath: "/"    # Optional