Resource Group

Azure Resource Groups are logical containers for related resources. A resource group can contain all or some resources for a solution, but typically they are used to group resources which have a similar lifespan.

The following example will deploy a simple Resource group in an existing 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-keyvault
    ConnectionName: az-jd-sub1
    Location: uksouth
    # Optional
    Tag:
      ProjectManager: FredSmith
      CostCenter: 666
    Lock:
      - Name: lock-rg
        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.