Skip to main content
Version: Next

Task 01: Pre-Registration Environment Validation

Runbook Phase 04 Platform

Status: Active | Estimated Time: 20 minutes (identity) + 15 min/node (connectivity) | Last Updated: 2026-03-07


Overview

Before registering nodes with Azure Arc, validate two categories of prerequisites:

  1. Identity & Permissions — verify the service principal exists, has the correct RBAC roles on the Arc resource group, and that its secret is accessible in Key Vault. If deploying interactively, verify your own account permissions.
  2. Connectivity — run the Environment Checker on each cluster node to confirm end-to-end reachability to all required Azure endpoints.
Two-Part Validation

Step 1 (Identity & Permissions) runs from the management server or any Azure-authenticated machine — it validates Azure-side prerequisites. Step 2 (Connectivity) runs on or against each cluster node — it validates network-level reachability from the node OS itself.


Prerequisites

RequirementDetails
Phase 03 completeOS configured, hostnames set, nodes restarted
Node accessRDP or console access to each node
Internet connectivityNodes can reach PSGallery and Azure endpoints
Azure modulesAz.Accounts, Az.Resources, Az.KeyVault installed on management machine
Service principalCreated with App ID; secret stored in Key Vault

Variables from variables.yml

PathTypeDescription
identity.service_principal.client_idstringSPN Application (Client) ID
compute.azure_local.arc_resource_groupstringArc resource group name
security.keyvault.kv_azl.kv_azl_namestringKey Vault name for SPN secret
compute.azure_local.arc_gateway_idstringArc Gateway resource ID
compute.cluster_nodes[].management_ipstringNode management IPs
azure_platform.tenant.idstringAzure Tenant ID
azure_platform.subscriptions.lab.idstringAzure Subscription ID
azure_platform.regionstringAzure region

Step 1: Identity & Permission Checks

Verify the service principal (or interactive user) has the required Azure permissions before connecting to cluster nodes. Run from the management server or any machine with Azure authentication.

What Gets Checked
  1. SPN exists in Entra ID with the configured App ID
  2. RBAC roles — SPN has required permissions on the Arc resource group
  3. Key Vault — SPN secret is stored and accessible
  4. Arc Gateway — Gateway resource exists and is provisioned (skip with -NoArcGateway)

Run from any machine with an active Azure session.

# Task 01 Step 1 — Identity & Permission Checks (manual)

Connect-AzAccount -TenantId "REPLACE_TENANT_ID" -SubscriptionId "REPLACE_SUBSCRIPTION_ID"

$SpnAppId = "REPLACE_SPN_APP_ID"
$ResourceGroup = "REPLACE_RESOURCE_GROUP"
$VaultName = "REPLACE_VAULT_NAME"
$SecretName = "REPLACE_SECRET_NAME"

if ($SpnAppId -match '^REPLACE_') { throw 'Edit the REPLACE_ variables before running.' }

# --- Check 1: Verify SPN exists in Entra ID ---
$spn = Get-AzADServicePrincipal -ApplicationId $SpnAppId -ErrorAction SilentlyContinue
if ($spn) {
Write-Host "[PASS] SPN exists: $($spn.DisplayName) ($SpnAppId)" -ForegroundColor Green
} else {
Write-Host "[FAIL] SPN not found: $SpnAppId" -ForegroundColor Red
}

# --- Check 2: Verify RBAC roles on the Arc resource group ---
if ($spn) {
$roles = Get-AzRoleAssignment -ObjectId $spn.Id -ResourceGroupName $ResourceGroup `
-ErrorAction SilentlyContinue
$roles | Format-Table RoleDefinitionName, Scope -AutoSize

$accepted = @(
'Contributor',
'Azure Connected Machine Onboarding',
'Azure Connected Machine Resource Administrator',
'Azure Stack HCI Administrator'
)
$matched = $roles | Where-Object { $_.RoleDefinitionName -in $accepted }
if ($matched) {
$matched | ForEach-Object {
Write-Host "[PASS] Role: $($_.RoleDefinitionName)" -ForegroundColor Green
}
} else {
Write-Host "[FAIL] No recognized Arc role on '$ResourceGroup'" -ForegroundColor Red
Write-Host " Assign: Azure Connected Machine Onboarding (minimum)" -ForegroundColor Yellow
}
}

# --- Check 3: Verify Key Vault has SPN secret ---
$secret = Get-AzKeyVaultSecret -VaultName $VaultName -Name $SecretName -ErrorAction SilentlyContinue
if ($secret -and $secret.Enabled) {
Write-Host "[PASS] KV secret '$SecretName' accessible and enabled" -ForegroundColor Green
if ($secret.Expires -and $secret.Expires -lt (Get-Date).AddDays(30)) {
Write-Host "[WARN] Secret expires $($secret.Expires) — renew soon" -ForegroundColor Yellow
}
} elseif ($secret) {
Write-Host "[WARN] KV secret '$SecretName' exists but is DISABLED" -ForegroundColor Yellow
} else {
Write-Host "[FAIL] KV secret '$SecretName' not found in vault '$VaultName'" -ForegroundColor Red
}

Step 2: Connectivity Validation

Run the Environment Checker on each cluster node to confirm end-to-end connectivity to all required Azure endpoints.

Why Run From the Nodes?

OS configuration is now complete on the cluster nodes. Running Environment Checker directly from the nodes confirms that DNS, firewall, and NIC configuration all work end-to-end from the node itself — not just from the management network.

Run on each node individually via RDP or console.

# Task 01 Step 2 — Connectivity Validation (run on each node)

Install-Module -Name AzStackHci.EnvironmentChecker -Repository PSGallery -Force -AllowClobber
Import-Module AzStackHci.EnvironmentChecker

Invoke-AzStackHciConnectivityValidation -Verbose | Format-Table Name, Status, Description -AutoSize

Expected Results

Identity & Permissions

CheckExpected
SPN exists (Entra ID)Found with correct App ID and Display Name
RBAC role on Arc resource groupContributor or Azure Connected Machine Onboarding
Key Vault secretAccessible and enabled (not expired)
Arc GatewayExists in Azure, provisioning state Succeeded (skip with -NoArcGateway)
Current user contextAuthenticated to correct tenant and subscription

Connectivity

All Environment Checker tests should show Succeeded:

ValidationExpected
Azure Resource Manager endpointSucceeded
Azure Active Directory endpointSucceeded
Azure Arc endpointsSucceeded
Graph API endpointsSucceeded
Azure Storage endpointsSucceeded
Windows Update endpointsSucceeded

Troubleshooting

IssueResolution
SPN not foundVerify identity.service_principal.client_id in variables.yml matches Entra ID app registration
No RBAC role on RGAssign Azure Connected Machine Onboarding (minimum) on the Arc resource group
KV secret not accessibleCheck Key Vault access policies or RBAC; verify secret name matches the keyvault:// URI in YAML
Secret expired or disabledRotate the SPN secret in Entra ID and update Key Vault
DNS resolution failuresVerify DNS servers in node network config (Phase 03 Task 05)
Timeout errorsCheck firewall rules for node IPs
Certificate errorsAdd Azure endpoints to TLS inspection bypass
Module install failsAllow *.powershellgallery.com outbound

↑ Phase 04 · Task 02: Register Nodes with Arc →