Storage Account

The following example will deploy a Resource Group and a simple Storage Account with a single container for blob storage in an Azure subscription.

---
Connection:
# Replace the TenantId and SubscriptionID with your values
  - Name: az-jd-sub1
    Azure: 
      Environment: AzureCloud
      TenantId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
      Context:
        SubscriptionId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

# -------------------------------------------------------------------------------------------------------------------

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

azStorage:
    # Mandatory
  - Name: stjdexstorage
    ConnectionName: az-jd-sub1
    ResourceGroupName: rg-jdex-storage
    Location: uksouth
    SkuName: Standard_LRS       # "Standard_LRS,Standard_ZRS,Standard_GRS,Standard_RAGRS,Premium_LRS,Premium_ZRS,Standard_GZRS,Standard_RAGZRS"
    # Optional
    Tag:
      ProjectManager: FredSmith
      CostCenter: 666
    Lock:
      - Name: lock-storage
        Level: CanNotDelete     # CanNotDelete, ReadOnly
        Notes: 'stop accidental deletion'

Copy the above into a new .yml file and substitute in your tenant and subscription ids.

Validation

Execute the following powershell command to validate your resources. You will be prompted to authenticate to Azure with a suitable Microsoft account. Please ensure the account you choose has the relevant permissions to check your resources.

Confirm-JDResource -Verbose -Type All -DeploymentFile "<filename>.yml"

The above command will validate the resources in the yaml file. The -Type parameter allows the execution of just part of a yaml file that may contain other resource types.

Deployment

Execute the following powershell command to deploy your resources. You will be prompted to authenticate to Azure with a suitable Microsoft account. Please ensure the account you choose has the relevant permissions to check your resources.

Deploy-JDResource -Verbose -Type All -DeploymentFile "<filename>.yml"

The above command will create all resource types in the yaml file. The -Type parameter allows the execution of just part of a yaml file that may contain other resource types.