Deployment Flow
Preview
Section titled “Preview”New-AzureSqlVmToolkitDeployment -ConfigFile .\config.local.yaml -SecurityAssessmentAdvice -PlanThe preview validates config and prints intended resource names without Azure calls.
Use Azure-aware -WhatIf after signing in to check real create/reuse/update/drift decisions without mutating resources:
Connect-AzAccountNew-AzureSqlVmToolkitDeployment -ConfigFile .\config.local.yaml -WhatIfDeployment Steps
Section titled “Deployment Steps”After Connect-AzAccount, the module command runs the same reconciliation order through internal Ensure-* functions:
- Creates or reuses the VM resource group.
- Creates or reuses the storage resource group.
- Creates or validates an RBAC-enabled Key Vault.
- Assigns Key Vault secret permissions.
- Reuses the VM admin password secret, or generates one only with
-GeneratePassword. - Creates or reuses VNet, subnet, NSG, NIC, and optional VM public IP.
- Creates or reuses the SQL Server VM.
- Enables system-assigned managed identity.
- Creates or reuses Bastion subnet, Bastion public IP, and Bastion host.
- Creates or reuses storage account and Azure Files share.
- Stores the storage account key in Key Vault.
- Grants the VM identity secret-reader permission.
- Runs trusted guest setup through VM Run Command.
- Mounts Azure Files in the VM and registers a startup task.
- Uploads
restore-databases.ps1.
Reruns
Section titled “Reruns”The toolkit uses create-or-reuse behavior for the major Azure resources and reports structured step results. Unsafe drift fails early for resources that should not be silently reused, including wrong VNet/subnet prefixes, wrong NIC attachments, legacy Key Vault access-policy mode, VM size drift, and VM image drift. Missing safe items such as role assignments, managed identity, Bastion subnet, and configured NSG rules are handled as updates.