Azure landing zone Documentation
Home GitHub Issue Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Phase 2 - Bootstrap

Follow these instructions to bootstrap your Version Control System and Azure ready to deploy your Platform landing zone.

  1. Run the following command, updating it for your chosen Infrastructure as Code, Version Control System and scenario number:

    $iacType = "terraform"  # Must be one of: "bicep", "bicep-classic", "terraform"
    $versionControl = "github"  # Must be one of: "azure-devops", "github", "local"
    $scenarioNumber = 1  # Must be a number between 1 and 9 for Terraform only. Ignored for Bicep.
    $targetFolderPath = "~/accelerator" # Choose your target folder for the cached files
    
    $alzModule = Get-InstalledPSResource -Name ALZ
    if (-not $alzModule) {
        Install-PSResource -Name ALZ
    } else {
        Update-PSResource -Name ALZ
    }
    
    New-AcceleratorFolderStructure `
        -iacType $iacType `
        -versionControl $versionControl `
        -scenarioNumber $scenarioNumber `
        -targetFolderPath $targetFolderPath
    
    Tip
    Terraform scenarios can be found in the scenarios docs section.
  2. Open your inputs.yaml bootstrap configuration file in Visual Studio Code and provide values for each input in the required section.

    code "$targetFolderPath/config"
    
    Tip
    More details about the configuration files can be found in the configuration files section.
  3. Review and update the Platform landing zone configuration file.

    The starter_locations input is required and must be updated in this file to include at least one Azure region for your Platform landing zone.

    More details can be found in the relevant section for your chosen Infrastructure as Code tool:

    Tip
    Terraform options can be found in the options docs section.
  4. Login to Azure CLI replacing the tenant and subscription IDs with your own to target you bootstrap subscription:

    az login --tenant 00000000-0000-0000-0000-000000000000 --use-device-code
    az account set --subscription 00000000-0000-0000-0000-000000000000
    
  5. In your terminal install and run the ALZ bootstrap module:

    JSON instead of YAML
    If you are unable to install the powershell-yaml module (the ALZ module tries to install this automatically for you when invoked), you can use .json files instead; see Configuration Files for more information.
    if($iacType -eq "terraform") {
        Deploy-Accelerator `
        -inputs "$targetFolderPath/config/inputs.yaml", "$targetFolderPath/config/platform-landing-zone.tfvars" `
        -starterAdditionalFiles "$targetFolderPath/config/lib" `
        -output "$targetFolderPath/output"
    }
    
    if($iacType -eq "bicep") {
        Deploy-Accelerator `
        -inputs "$targetFolderPath/config/inputs.yaml", "$targetFolderPath/config/platform-landing-zone.yaml" `
        -output "$targetFolderPath/output"
    }
    
    if($iacType -eq "bicep-classic") {
        Deploy-Accelerator `
        -inputs "$targetFolderPath/config/inputs.yaml" `
        -output "$targetFolderPath/output"
    }
    
  6. Once it generates the plan, hit enter to deploy the bootstrap.

    Tip
    You can now update your Azure Landing Zone Terraform Accelerator Runner Registration GitHub PAT (token-2) to restrict it to the main repository created by the bootstrap.
  7. For Bicep only, clone your newly created repository to your local machine and make any changes required to the parameter files. See the Bicep getting started guide for more information on customizing the parameter files. Commit and push any changes to your repository. For the local file system option, you can make changes directly in the output folder.

Next Steps

Now head to Phase 3.