Skip to content

Deployment

SYNOPSIS

The template DeployIfNotExists deploys, and the values it passes to the template's parameters. Use inside DeployIfNotExists.

SYNTAX

Deployment [[-Options] <Object>] [-TemplateFile <String>] [-Template <IDictionary>] [-Parameters <IDictionary>] [-Scope <String>] [-Location <Object>] [<CommonParameters>]

DESCRIPTION

One-line form: Deployment -TemplateFile ./templates/sql-tde.json -Scope Subscription -Location (Param Location) Hashtable form: Deployment @{ TemplateFile = './templates/sql-tde.json'; Scope = 'Subscription'; Location = (Param Location) }

The hashtable form takes the same options as keys, one per line, for a deployment too long for one line (ADR-0031).

USED IN

DeployIfNotExists

EXAMPLES

Example 1

Deployment -TemplateFile ./templates/sql-tde.json -Parameters @{
    fullDbName = Arm "[field('fullName')]"
}

Example 2

Deployment @{
    TemplateFile = './templates/security-contacts.json'
    Scope        = 'Subscription'
    Location     = 'northeurope'
    Parameters   = [ordered]@{
        emailAddress    = Param EmailAddress
        minimalSeverity = Param MinimalSeverity
    }
}

PARAMETERS

-Options

The options as a hashtable, with the keys TemplateFile, Template, Parameters, Scope and Location.

Type: Object
Required: false
Position: 1
Accept pipeline input: false

-TemplateFile

An ARM template JSON file, relative to the .bylaw.ps1 file's folder.

Type: String
Required: false
Position: named
Accept pipeline input: false

-Template

The ARM template as a hashtable. Use [ordered] to keep its key order.

Type: IDictionary
Required: false
Position: named
Accept pipeline input: false

-Parameters

Template parameter name -> value: a literal, Param, Arm or ResourceGroupTag.

Type: IDictionary
Required: false
Position: named
Accept pipeline input: false

-Scope

Where to deploy: ResourceGroup (Azure's default) or Subscription.

Type: String
Required: false
Position: named
Accept pipeline input: false

-Location

The deployment's location: a literal, Param or Arm. Required with -Scope Subscription.

Type: Object
Required: false
Position: named
Accept pipeline input: false