Phase 2 - Bootstrap
Follow these instructions to bootstrap your Version Control System and Azure ready to deploy your Platform landing zone.
Copy the following variables to Notepad and edit them for your chosen settings:
$iacType = "terraform" # Must be one of: "bicep" (Recommended), "terraform" (Recommended), or "bicep-classic" (Not Recommended) $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 filesTipTerraform scenarios can be found in the scenarios docs section.Open a new PowerShell terminal and copy and paste it in there from Notepad to run it. You’ll need these variables set for subsequent steps, so keep the terminal open or run this again if you open a new new terminal.
Run the following command to install or update the ALZ PowerShell module:
$alzModule = Get-InstalledPSResource -Name ALZ 2>$null if (-not $alzModule) { Install-PSResource -Name ALZ } else { Update-PSResource -Name ALZ }Run the following command to create the folder structure for your bootstrap:
New-AcceleratorFolderStructure ` -iacType $iacType ` -versionControl $versionControl ` -scenarioNumber $scenarioNumber ` -targetFolderPath $targetFolderPathRun this command to open your config folder in Visual Studio Code:
code (Resolve-Path "$targetFolderPath/config").PathTipIf you don’t have Visual Studio Code installed, you can navigate to the config folder using File Explorer or your preferred file manager.Open your
inputs.yamlbootstrap configuration file in Visual Studio Code and provide values for each input in the required section.TipMore details about the configuration files can be found in the configuration files section.Open your Platform landing zone configuration file in Visual Studio Code and provide values for each required input.
The file extension differs for each Infrastructure as Code tool. You can learn more about the specific settings for each tool in the relevant starter module documentation:
- Terraform:
platform-landing-zones.tfvars- Terraform Azure Verified Modules for Platform landing zone (ALZ) - Bicep:
platform-landing-zone.yaml- Bicep Azure Verified Modules for Platform landing zone (ALZ)
Update the following required inputs in the file:
starter_locations: you must update all the<region-#>placeholders with valid Azure regions for your Platform landing zone.defender_email_security_contact: (Terraform only) this must be updated to include an email address for your security contact for Microsoft Defender for Cloud alerts.
TipTerraform options can be found in the options docs section.- Terraform:
Login to Azure CLI replacing the tenant and subscription IDs with your own to target your desired bootstrap subscription:
az login --tenant "<tenant-id>" --use-device-code az account set --subscription "<bootstrap-subscription-id>"In your terminal run the ALZ module to bootstrap your environment:
JSON instead of YAMLIf you are unable to install thepowershell-yamlmodule (the ALZ module tries to install this automatically for you when invoked), you can use.jsonfiles instead; see Configuration Files for more information.if(!$iacType) { throw "iacType variable is not set. Please set it to one of: 'bicep', 'terraform', or 'bicep-classic'." } 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" }Once it generates the plan, hit enter to deploy the bootstrap.
TipYou can now update yourAzure Landing Zone Terraform Accelerator Runner RegistrationGitHub PAT (token-2) to restrict it to the main repository created by the bootstrap.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.
Now head to Phase 3.
