Skip to content

Guest Setup

Guest setup runs through Azure VM Run Command after the VM exists.

The sample config now declares package metadata:

softwareInstalls:
allowDynamicBootstrap: true
packages:
- manager: "Chocolatey"
name: "git.install"
version: "2.54.0"
- manager: "PowerShellGallery"
name: "dbatools"
version: "2.7.25"

The toolkit generates pinned install commands from this metadata. Chocolatey package entries may also include sha256; when present, the generated choco install command passes it as --checksum ... --checksum-type sha256.

sha256 is intentionally rejected for PowerShellGallery packages because the current install path does not enforce a package checksum. sourceUri is a review/provenance reference only; it is not used as the install source.

allowDynamicBootstrap: true still permits Chocolatey bootstrap download during deployment, so hardened environments should either preinstall Chocolatey in the VM image or provide a verified internal bootstrap source and package mirror.

softwareInstalls.installScript remains available as an additional custom hook after the structured package installs. Keep it small, reviewed, and free of secrets.

The sample logon script installs the SQL Server VS Code extension:

Terminal window
code --install-extension ms-mssql.mssql

Only use trusted logon script content.

The VM managed identity retrieves the storage-key secret from Key Vault and mounts Azure Files to the configured drive letter. The mount script is also registered as a startup scheduled task.

The script uploads restore-databases.ps1 to the Azure Files share. It restores .bak files from the configured backup path using dbatools.

Run it manually inside the VM after reviewing the backup files.