Skip to main content

Task 10: Key Vault

Runbook Azure

DOCUMENT CATEGORY: Runbook
SCOPE: Key Vault deployment
PURPOSE: Create centralized secret management for Azure Local infrastructure
MASTER REFERENCE: Microsoft Learn - Key Vault

Status: Active

Overview​

This task creates the management Key Vault used to store deployment secrets (VPN shared keys, domain admin passwords, service account credentials) and certificates. All scripts that reference keyvault:// URIs in infrastructure.yml resolve secrets from this vault.

Task Classification

Execution Target: Azure-Only (control-plane API operation) Tab Profile: 3 tabs — Azure Portal · PowerShell · Azure CLI

Terraform Reference

Module: azurelocal-toolkit File: key-vault.tf Mode: Management

Components Created​

ResourceName PatternPurpose
Key Vaultkv-{customer}-platformManagement secrets store

Key Vault Configuration​

SettingValueSource
NamePer configkey_vaults[].name
SKUStandardFixed: the vaults hold secrets only (Microsoft Learn: Azure Key Vault service tiers)
Soft delete retention7 to 90 days, default 90 (the Azure default)key_vaults[].soft_delete_retention_days
Purge protectionOn, except when the environment class is lab, test or devscenario.environment_class
RBAC authorizationEnabledFixed: Azure RBAC, no access policies
Network accessAzure default (all networks); restrict it with your network design after the vault existsNot set by the script

Secrets to Populate​

Secret NamePurposeConfig Path
azlocal-admin-passwordAzure Local node admina keyvault:// reference in the key that needs the secret
recovery-admin-passwordRecovery admina keyvault:// reference in the key that needs the secret
vpn-shared-keyS2S VPN PSKa keyvault:// reference in the key that needs the secret

Prerequisites​

  • Resource group exists
  • Key Vault Administrator or Contributor role
  • Secrets values prepared (do NOT store in YAML — use Key Vault only)

Values from infrastructure.yml​

The script reads these keys from infrastructure.yml (schema 5). Each key, with its type, default and example, is in the variables reference.

azure.tenant_id, azure.location, tags, scenario.environment_class
key_vaults[].name, .subscription_id, .resource_group, .purpose
every keyvault://<vault>/<secret> reference anywhere in the file (names only; no value is read)

The Terraform route (src/terraform/modules/identity, the platform Key Vault, key_vaults[] with purpose: management) also reads two keys added in registry 5.0.62 (schema 5.6.28, optional): key_vaults[].soft_delete_retention_days (days a deleted secret or the vault stays recoverable, 7 to 90, default 90) and key_vaults[].allowed_ip_ranges (public IP addresses or CIDR ranges that may reach the vault; empty keeps the Azure default, all networks).


Single Subscription Model​

Landing Zone Placement​

FieldValueConfig Path
SubscriptionCustomer subscriptionlanding_zone.subscriptions[].id
Resource Grouprg-azrlmgmt-{env}-{region}-01key_vaults[].resource_group
Key Vault NamePer configkey_vaults[].name

Execution Options​

Azure Portal​

When to use: Learning Azure Local, single deployment, prefer visual interface

Procedure​

  1. Create Key Vault:
  • Search for Key vaults → + Create | Field | Value | Source | |-------|-------|--------| | Name | Per config | key_vaults[].name | | Subscription | Target subscription | landing_zone.subscriptions[].id | | Resource Group | Management RG | key_vaults[].resource_group | | Region | Your region | azure.location | | Pricing tier | Standard | — |
  1. Access Configuration: | Field | Value | |-------|-------| | Permission model | Azure role-based access control (recommended) | | Resource access | Enable Azure Resource Manager for template deployment | | Resource access | Enable Azure Virtual Machines for deployment |

  2. Networking: | Field | Value | |-------|-------| | Public access | All networks (required for Azure Local today) | | Allow trusted Microsoft services | Yes |

  3. Review + create: Verify → Click Create

  4. Add Secrets: For each secret in the table above:

  • Key Vault → Secrets → + Generate/Import
  • Set Name and Value for each secret

Validation​

  • Key Vault provisioning state: Succeeded
  • RBAC authorization enabled
  • All required secrets present
  • Soft delete enabled

Validation​

  • Key Vault provisioned
  • RBAC authorization enabled
  • Soft delete and purge protection enabled
  • All required secrets populated

CAF/WAF Landing Zone Model​

In the CAF/WAF model, the management Key Vault is deployed in the Management subscription.

Landing Zone Placement​

FieldValueConfig Path
SubscriptionManagement subscriptionlanding_zone.subscriptions[].id
Resource Grouprg-azrlmgmt-{env}-{region}-01key_vaults[].resource_group
Key Vault NamePer configkey_vaults[].name
Cluster Key Vault

A separate cluster Key Vault exists in the Cluster resource group for cluster-specific secrets. That is part of Stage 14-15 (Cluster Deployment), not this task.

Execution Options​

Azure Portal​

Follow the same procedure as Single Subscription → Azure Portal, targeting the Management subscription.

Validation​

  • Key Vault in Management subscription
  • Cross-subscription access works via RBAC

Validation​

  • Key Vault in Management subscription
  • RBAC assignments for operators in other subscriptions

Troubleshooting​

IssueRoot CauseRemediation
Name already takenKey Vault names globally uniqueChoose different name or recover soft-deleted vault
Soft-deleted vault blocks creationSame name in deleted statePurge: Remove-AzKeyVault -VaultName $name -InRemovedState -Location $location
Cannot access secretsMissing RBAC roleAssign Key Vault Secrets User or Key Vault Administrator
Network access deniedFirewall blockingAdd client IP to network ACLs or use Azure Services bypass
Purge protection cannot be disabledBy design — irreversiblePlan purge protection before creation


Alternatives​

The procedures in this task use the methods shown in the tabs above. The toolkit is PowerShell 7 only and has no Bash scripts. A few tasks that act on Azure also have an Azure CLI script written in PowerShell. The script status page of the toolkit lists which task has which script.

PreviousUpNext
Task 09: Log AnalyticsManual Deployment IndexTask 11: Deploy Management VMs

Version Control

  • Created: 2025-09-15 by Hybrid Cloud Solutions
  • Last Updated: 2026-03-03 by Hybrid Cloud Solutions
  • Version: 4.0.0
  • Tags: azure-local, key-vault, security, secrets
  • Keywords: Key Vault, secrets, certificates, credentials, RBAC, soft delete
  • Author: Hybrid Cloud Solutions

Version Control​

VersionDateAuthorChanges
1.0.02025-03-25Azure Local CloudInitial release