Skip to content

Getting started Dependency pipeline

CARMLPipelinePrincipal edited this page Apr 12, 2022 · 1 revision

In order to successfully deploy and test all ARM/Bicep modules in your desired environment some modules require certain Azure resources to be deployed beforehand.

Note: If we speak of modules in this context we mean the services which get created from these modules.


Navigation


Resources deployed by the dependency workflow

Together with the resource modules pipelines, we are providing a dependency pipeline, leveraging resource parameters from the utilities\dependencies subfolder and either one of the following pipelines:

  • GitHub workflow: .github\workflows\platform.dependencies.yml
  • Azure DevOps pipeline: .azuredevops\platformPipelines\platform.dependencies.yml

The resources deployed by the dependency workflow need to be in place before testing all the modules. Some of them (e.g. [storage account], [key vault] and [event hub namespace]) require a globally unique resource name. Before running the dependency workflow, it is required to update those values and their corresponding references in the resource modules parameters.

Note: By default, the parameter files make use of the placeholder token '<<namePrefix>>' to make all resource names specific to an environment. Refer to Parameter File Tokens Design for more details.

Some of the resources integrated with the full dependency pipeline are disabled by default as they require more time to be deployed or because they may cause issues when running in parallel with some of our module validation pipelines. Those are the sqlmi dependencies and the resources needed to build and distribute a VHD in a storage account. We suggest to enable them explicitly in case you need to onboard the modules requiring them, i.e. respectively [SQL managed instance], [compute disks] and [compute images].

Dependency Pipeline

Since also dependency resources are in turn subject to dependencies with each other, resources are deployed in the following grouped order.

1st level resources
  1. Resource Groups: Leveraged by all modules. Multiple instances are deployed:
    • 'validation-rg': The resource group to which resources are deployed by default during the test deployment phase. This same resource group is also the one hosting the dependencies.
2nd level resources

This group of resources has a dependency only on the resource group which will host them. Resources in this group can be deployed in parallel.

  1. Storage account: This resource is leveraged by all resources supporting diagnostic settings on a storage account.

    Note: This resource has a global scope name.

  2. Event hub namespace and Event hub: This resource is leveraged by all resources supporting diagnostic settings on an event hub.

    Note: This resource has a global scope name.

  3. Log analytics workspaces: These resources are leveraged by all resources supporting diagnostic settings on LAW. Multiple instances are deployed:
    • 'adp-<<namePrefix>>-az-law-x-001': Default LAW.
    • 'adp-<<namePrefix>>-az-law-aut-001': Dedicated LAW to be leveraged by the [automation account] resource.
    • 'adp-<<namePrefix>>-az-law-appi-001': Dedicated LAW to be leveraged by the [application insights] resource.
  4. User assigned identity: This resource is leveraged by the [role assignment], [key vault] and [recovery services vault] dependency resources.

    Note: The object ID of the [user assigned identity] is needed by several dependency parameter files. However, before running the dependency pipeline for the first time, the [user assigned identity] resource does not exist yet, thus its object ID is unknown. For this reason, instead of the object ID value, some dependency parameter files contain the "<<msiPrincipalId>>" token, for which the correct value is retrieved and replaced by the pipeline at runtime.

  5. Shared image gallery and definition: These resources are leveraged by the [image template] resource.
  6. Route table: This resource is leveraged by the virtual network subnet dedicated to test [SQL managed instance].

    Note: This resource is deployed and configured only if sqlmi dependency resources are enabled.

  7. Route table: This resource is leveraged by a test subnet deployment of the [Virtual Network] module.
  8. Action group: This resource is leveraged by [activity log alert] and [metric alert] resources.
  9. Application security group: This resource is leveraged by the [network security group] resource.
  10. Policy assignment: This resource is leveraged by the [policy exemption] resource.
  11. Proximity placement group: This resource is leveraged by a test deployment of the [Availability set] module.
3rd level resources

This group of resources has a dependency on one or more resources in the group above. Resources in this group can be deployed in parallel.

  1. Storage Account Upload: An upload job to populate the storage account configured in parameters.json with a test script that can be referenced
  2. AVD host pool: This resource supports monitoring, hence it has a dependency on the [storage account], [log analytics workspace] and [event hub] deployed in the group above. This resource is leveraged by the [AVD application group] resource.
  3. Network Security Groups: This resource supports monitoring, hence it has a dependency on the [storage account], [log analytics workspace] and [event hub] deployed in the group above. This resource is leveraged by different virtual network subnets. Multiple instances are deployed:
    • 'adp-<<namePrefix>>-az-nsg-x-apgw': NSG with required network security rules to be leveraged by the [application gateway] subnet.
    • 'adp-<<namePrefix>>-az-nsg-x-ase': NSG with required network security rules to be leveraged by the [app service environment] subnet.
    • 'adp-<<namePrefix>>-az-nsg-x-bastion': NSG with required network security rules to be leveraged by the [bastion host] subnet.
    • 'adp-<<namePrefix>>-az-nsg-x-sqlmi': NSG with required network security rules to be leveraged by the [sql managed instance] subnet.

      Note: This resource is deployed and configured only if sqlmi dependency resources are enabled.

    • 'adp-<<namePrefix>>-az-nsg-x-001': default NSG leveraged by all other subnets.
  4. Application insight: This resource supports monitoring, hence it has a dependency on the [storage account], [log analytics workspace] and [event hub] deployed in the group above. This resource is leveraged by the [machine learning service] resource.
  5. Automation account: This resource supports monitoring, hence it has a dependency on the [storage account], [log analytics workspace] and [event hub] deployed in the group above. This resource is leveraged by the [log analytics workspace] resource.
  6. Public IP addresses: This resource supports monitoring, hence it has a dependency on the [storage account], [log analytics workspace] and [event hub] deployed in the group above. Multiple instances are deployed:
    • 'adp-<<namePrefix>>-az-pip-x-apgw': Leveraged by the [application gateway] resource.
    • 'adp-<<namePrefix>>-az-pip-x-bas': Leveraged by the [bastion host] resource.
    • 'adp-<<namePrefix>>-az-pip-x-lb': Leveraged by the [load balancer] resource.
    • 'adp-<<namePrefix>>-az-pip-min-lb': Leveraged by the [load balancer] resource.
    • 'adp-<<namePrefix>>-az-pip-x-fw': Leveraged by the [Azure firewall] resource.
  7. Role assignment: This resource assigns the 'Contributor' role on the subscription to the [user assigned identity] deployed as part of the group above. This is needed by the [image template] deployment.
  8. Key vault: This resource supports monitoring, hence it has a dependency on the [storage account], [log analytics workspace] and [event hub] deployed in the group above. Multiple instances are deployed:
    • 'adp-<<namePrefix>>-az-kv-x-001': KV with required secrets, keys, certificates and access policies to be leveraged by all resources requiring access to a key vault key, secret and/or certificate, i.e. [application gateway], [azure NetApp file], [azure SQL server], [disk encryption set], [machine learning service], [virtual machine], [virtual machine scale set], [virtual network gateway connection].
    • 'adp-<<namePrefix>>-az-kv-x-pe': KV to be leveraged by the [private endpoint] resource.
    • 'adp-<<namePrefix>>-az-kv-x-sqlmi': KV with required secrets, keys and access policies to be leveraged by the [SQL managed instance] resource.

      Note: This resource is deployed and configured only if sqlmi dependency resources are enabled.

    Note: This resource has a global scope name.

  9. Recovery services vault: This resource supports monitoring, hence it has a dependency on the [storage account], [log analytics workspace] and [event hub] deployed in the group above. This resource is leveraged by the [virtual machine] resource when backup is enabled.
4th level resources

This group of resources has a dependency on one or more resources in the groups above. Resources in this group can be deployed in parallel.

  1. AVD application group: This resource is leveraged by the [AVD workspace] resource.
  2. Virtual Networks: This resource is depending on the route table and network security groups deployed above. Multiple instances are deployed:
    • 'adp-<<namePrefix>>-az-vnet-x-peer01': Leveraged by the [virtual network peering] resource.
    • 'adp-<<namePrefix>>-az-vnet-x-peer02': Leveraged by the [virtual network peering] resource.
    • 'adp-<<namePrefix>>-az-vnet-x-azfw': Leveraged by the [azure firewall] resource.
    • 'adp-<<namePrefix>>-az-vnet-x-aks': Leveraged by the [azure kubernetes service] resource.
    • 'adp-<<namePrefix>>-az-vnet-x-sqlmi': Leveraged by the [sql managed instance] resource.

      Note: This resource is deployed and configured only if sqlmi dependency resources are enabled.

    • 'adp-<<namePrefix>>-az-vnet-x-001': Hosting multiple subnets to be leveraged by [virtual machine], [virtual machine scale set], [service bus], [azure NetApp files], [azure bastion], [private endpoints], [app service environment] and [application gateway] resources.
  3. Azure Image Builder template: This resource triggers the build and distribution of a VHD in a storage account. The VHD file is copied to a known storage account blob container and leveraged by [compute disks] and [compute images] resources. >Note: This resource is deployed and configured only if the 'Enable deployment of a vhd stored in a blob container' option is selected.
5th level resources

This group of resources has a dependency on one or more resources in the groups above.

  1. Virtual Machine: This resource is depending on the [virtual networks] and [key vault] deployed above. This resource is leveraged by the [network watcher] resource.
  2. Private DNS zone: This resource is depending on the [virtual networks] deployed above. This resource is leveraged by the [private endpoint] resource.

Required secrets and keys

The following secrets, keys and certificates need to be created in the key vaults deployed by the dependency workflow.

  • Shared key vault 'adp-<<namePrefix>>-az-kv-x-001'

    1. Key vault secrets:
      • administratorLogin: For [azure SQL server] .
      • administratorLoginPassword: For [azure SQL server].
      • vpnSharedKey: For [virtual network gateway connection].
      • adminUserName: For [virtual machine].
      • adminPassword: For [virtual machine].
    2. Key vault keys:
      • keyEncryptionKey: For [disk encryption set].
    3. Key vault certificate:
      • applicationGatewaySslCertificate: For [application gateway].
  • SQL Mi key vault 'adp-<<namePrefix>>-az-kv-x-sqlmi'

    1. Key vault secrets:
      • administratorLogin: For [SQL managed instance].
      • administratorLoginPassword: For [SQL managed instance].
    2. Key vault keys:
      • keyEncryptionKeySqlMi: For [SQL managed instance].
Clone this wiki locally