YAML

YAML is my personal favourite way to pass configuration data into JustDeploy. YAML is very readable and allows comments. Let us take a look at a sample YAML configuration file:

---
azResourceGroup:
    # Mandatory
  - Name: rg-jdex-keyvault
    ConnectionName: az-jd-sub1
    Location: uksouth
    # Optional
    Tag:
      ProjectManager: FredSmith
      CostCenter: 666

azKeyVault:
    # Mandatory
  - Name: vlt-jdex-keyvault
    ConnectionName: az-jd-sub1
    ResourceGroupName: rg-jdex-keyvault
    Location: uksouth
    # Optional
    Sku: Standard                               # Standard (D), Premium
    Tag:
      ProjectManager: FredSmith
      CostCenter: 666
    Lock:
      - Name: lock-vault
        Level: CanNotDelete                     # CanNotDelete, ReadOnly
        Notes: 'stop accidental deletion'

As you can see from above, it looks fairly straight forward and not too frightening. Let us take a look in closer detail.

Firstly all YAML files start with those 3 dashes, they must always be there to denote the start of the document. Do not delete them.

---

Then we move onto the resource objects, these are very readable. Each resource object is a list to allow for multiple items for each object type. In YAML the list is denoted by the hyphen (-) character. As you can see below (-Name). The first resource type is for an Azure Resource Group. Names are obviously always mandatory, but then the keys are separated into Mandatory and optional.
If no value is entered for an optional key, the key will ignored and any default will be used. If no value is specified for a mandatory key, then of course JustDeploy will display an error message. The ConnectionName key specifies the connection to use and therefore the subscription in which the resource will be created.

azResourceGroup:
    # Mandatory
  - Name: rg-jdex-keyvault
    ConnectionName: az-jd-sub1
    Location: uksouth
    # Optional
    Tag:
      ProjectManager: FredSmith
      CostCenter: 666

The next resource object is for Azure Key Vault. You will notice tags and locks are common on most Azure resource types, just delete the keys if you don’t need to supply values.
Often YAML files will be simpler if you remove keys that have no values as it makes them more readable, especially in large complex deployments.

azKeyVault:
    # Mandatory
  - Name: vlt-jdex-keyvault
    ConnectionName: az-jd-sub1
    ResourceGroupName: rg-jdex-keyvault
    Location: uksouth
    # Optional
    Sku: Standard                             # Standard (D), Premium
    Tag:
      ProjectManager: FredSmith
      CostCenter: 666
    Lock:
      - Name: lock-vault
        Level: CanNotDelete                   # CanNotDelete, ReadOnly
        Notes: 'stop accidental deletion'