Skip to main content

Appendix D: Script Index

Reference Azure

DOCUMENT CATEGORY: Reference
SCOPE: Toolkit script layout and status
PURPOSE: Show where the scripts are and how to find out which task has a real script MASTER REFERENCE: Azure Local Toolkit

Status: The toolkit is PowerShell 7 only. The status of every task folder is in the generated script status page of the toolkit.


Overview​

The toolkit scripts are PowerShell 7. There are no Bash scripts. A few tasks that act on Azure also have an Azure CLI script, written in PowerShell. Every script reads its values from infrastructure.yml.

Which task has a script? The toolkit keeps one generated page that says, for every task folder, whether it has a real script, per kind (PowerShell, Azure CLI): script status. It is generated from the task folders, so it is always right. This appendix does not repeat it.

WordMeaning
builtThe folder holds at least one real script
not builtThere is no real script. The folder holds only placeholders
not applicableThe task does not act on Azure (it runs on a node, against Active Directory, DNS or a BMC, or is operating system work), so it has no Azure CLI script

A placeholder is a script that does not do the task. Running it prints NOT IMPLEMENTED, changes nothing and ends with exit code 3. Use a real script of the task if there is one, or the steps on the guide page.

Layout​

The toolkit repository is azurelocal-toolkit:

FolderWhat it holds
scripts/deploy/<stage>/<phase>/<task>/powershell/The PowerShell scripts of a task
scripts/deploy/<stage>/<phase>/<task>/azurecli/The Azure CLI scripts of a task (PowerShell files that call az)
scripts/deploy/common/The shared deploy scripts, the task catalogue and the script status generator
scripts/common/The modules and helpers the scripts share (infrastructure file, secrets, Redfish, remoting)
scripts/tools/Authoring and quality tools for the repository
scripts/deferred/Parked tasks. Nothing runs them and they are not a current focus: Windows Admin Center, backup and disaster recovery, PIM and conditional access, and the network device syslog collector

The stages under scripts/deploy are 01-cicd-infra, 02-azure-foundation, 03-onprem-readiness, 04-cluster-deployment, 05-operational-foundations, 06-testing-validation, 07-validation-handover (the validation checks, the deployment documentation and the customer transfer) and 08-day2-operations (check for updates, start the solution update, node maintenance and cluster operations).

Script Naming Convention​

Verb-Noun.ps1                       a script that does the task
Invoke-<Task>-Orchestrated.ps1 the entry point that runs a task for all nodes or all items
<Verb-Noun>.azcli.ps1 the Azure CLI variant

Script Template​

Every script follows one structure:

  1. Header: synopsis, description, the keys it reads, parameters, examples, exit codes
  2. Parameters: -InfrastructureFile (the master file, mandatory), -WhatIf where the script changes something, -LogPath. No script takes -ConfigPath or -ConfigFile. No script prompts: a credential comes from -Credential or from a secret reference in the file, else the script stops with exit code 2
  3. Validation: check the Azure connection and the prerequisites
  4. Execution: do the task, idempotent, with error handling
  5. Summary: report what was created, what was already there and what differs

A test fails the build when a script carries a value that a deployment chooses, and when a script parameter is not registered in the master registry.