Skip to content

Configuration ​

Sonar ends up with one configuration object, whichever way you configure it: from the master infrastructure.yml, from commands that fill in a file, or from a file written by hand. Look at what Sonar will use with:

powershell
Import-Module ./src/AzlSonar/AzlSonar.psd1
Get-AzlSonarConfig -InfrastructureFile ./infrastructure.yml     # or: -Path ./config/clus01.json
Test-AzlSonarConfig -Path ./config/clus01.json                  # problems only; empty when valid

Unknown keys are ignored. Sonar validates at start and lists every problem at once. A commented example with every key is examples/sonar.config.commented.jsonc (comments are allowed in config files).

Key reference ​

Types are JSON types. "Dashboard" says what the key changes on the page. "Master file" is the infrastructure.yml key that fills it when you use -InfrastructureFile (a dash means there is no such key: Sonar's default applies, or you give it another way). Every key below can be changed with Set-AzlSonarConfig (run it with no -Key to list the keys) (the node keys with Add-AzlSonarNode and Remove-AzlSonarNode); Update the configuration shows how.

KeyTypeRequiredDefaultExampleMaster fileWhat it changes in the dashboard
subscriptionIdstring (GUID)yes00000000-0000-0000-0000-000000000000azure.subscription_idWhich subscription every Azure read goes to. Wrong: no data, Azure 403/404 warnings. Details shows only its first 8 characters.
resourceGroupstringyesrg-example-azlazure.resource_groupThe resource group of the cluster, its Arc machines and edge machines.
locationstringnononeeastusazure.locationThe region shown in Details. Sonar does not use it to reach Azure.
clusterNamestringyesclus01cluster.nameThe cluster name in the top bar and the deploymentSettings that gives the step tree.
identityModelLocalIdentity or ActiveDirectoryyesActiveDirectoryscenario.identityThe account guidance in the Log access window, the This deployment note there, and whether TrustedHosts is checked.
provisioningRouteauto, simplified, oem-imagenoautosimplifiedscenario.os_install (simplified, iso)The first mode: Provisioning (ZTP) (edge machines) or Provisioning (OS image) (node probe). oem-image never reads edge machines; simplified never starts the node probe.
accessTokentrue or falsenotruefalse-false turns the per-start access token off: any account on the machine can read the page. Single-user machines only. -NoAccessToken does the same.
tokenFilestring (path)nonone./sonar.token- (use -TokenFile)File Sonar writes the access token to at start, and only the token, readable by the current user only (Windows: the current user's access control list without inheritance; Linux: mode 600); removed when Sonar stops. Relative to the config file. -TokenFile overrides it; an existing file that is not a Sonar token file is refused unless -Force. Not with accessToken: false. Automation reads it with Invoke-AzlSonarApi -TokenFile (the token file).
maxEventStreamsinteger 1 to 50no44-Live browser streams served at once; more get 429 and the page polls instead.
pollSecondsinteger 5 to 3600no2030- (use -PollSeconds)How often Azure is read; how fresh the page is. -PollSeconds overrides it.
nodeslistyes (one or more)see belownodes[]The machine cards, the steps per machine and the log filters.
nodes[].namestring, uniqueyesnode01nodes[].nameThe machine's name on the page.
nodes[].addressstringyes192.0.2.11the management port's ip_addressHost name or IP address Sonar connects to for logs (seed) and Arc status (OEM route).
nodes[].arcMachineNamestringnoresolvednode01nodes[].arc_machine_nameThe Arc machine to follow. Default: simplified route, the Arc machine the edge machine names; OEM route, the node name.
nodes[].seedbooleannofirst nodetruethe first nodeThe node whose logs are tailed. At most one; none marked means the first node (with a warning).
ztpEvents.pathstringnononeD:\Data\azl-ztp\evidence\ztp-events.jsonlprovisioning.simplified.evidence_path + ztp-events.jsonlThe ZTP event file. Without it there are no [ztp] log lines and no per-machine ZTP steps. Relative paths are relative to the config file.
discoveryPathstringnononeD:\Data\azl-ztp\evidence\discoveryhardware.discovery.output_directory when the file has it (relative to the folder of the master file; this key is not in infrastructure schema 5.6.32, so older files fall through), else provisioning.simplified.evidence_path + discoveryThe folder the toolkit's Invoke-HardwareDiscovery.ps1 wrote with -OutputPath (one <ServiceTag>.json per node and discovery-summary.json), or one of those files. A hardware inventory and AzL Beacon's results in the folder (or its beacon subfolder) are shown too; files of other tools are skipped. Sonar reads it (never an iDRAC) for the Discovery stage that comes before ZTP: service tag, ports and MACs, the suggested management port, the BOSS card. Without it the Discovery tile is grey and says how to get its data. Relative paths are relative to the config file.
osConfigEventsPathstringno<events folder>/os-configuration-events.jsonl with the master file, else noneD:\Data\azl-events\clus01\os-configuration-events.jsonldeployment.events_directory, else %ProgramData%\AzureLocalToolkit\<cluster.name>\eventsThe OS configuration event file written by the toolkit's Invoke-AzureLocalOsConfiguration.ps1, which writes it to the same events folder by default (-EventLogPath moves it; a run given -ReportDirectory writes it there instead unless the file sets deployment.events_directory). Without it the OS configuration mode has no steps and there are no [osconfig] log lines. Relative paths are relative to the config file.
armEventsPathstringno<events folder>/arm-deployment-events.jsonl with the master file, else noneD:\Data\azl-events\clus01\arm-deployment-events.jsonldeployment.events_directory, else %ProgramData%\AzureLocalToolkit\<cluster.name>\eventsThe ARM Validate and Deploy event file written by the toolkit's Invoke-AzureLocalArmDeployment.ps1, which writes it to the same events folder by default (a run given -ReportDirectory writes it there instead unless the file sets deployment.events_directory). Without it the Validate and Deployment modes show only what Azure reports and there are no [arm] log lines. Relative paths are relative to the config file. See Validate and Deploy from the toolkit.
updateEventsPathstringno<events folder>/update-events.jsonl with the master file, else noneD:\Data\azl-events\clus01\update-events.jsonldeployment.events_directory, else %ProgramData%\AzureLocalToolkit\<cluster.name>\eventsThe solution update event file written by the toolkit's update scripts. Read by the Auto and Update monitors: [update] log lines, and the Update view from the file when Azure reports no update run (no Azure context, a plan or -WhatIf run). With -Monitor Update this key (or an update-events.jsonl in the folder of armEventsPath, osConfigEventsPath or verificationEventsPath) is also what lets Sonar start with no Azure sign-in: it then shows the file only and marks the Azure live poll as not connected. Relative paths are relative to the config file. See Update.
verificationEventsPathstringno<gate report directory>/precluster-verification-events.jsonl with the master file, else noneD:\Data\azl-ztp\arm-report\verification\live\precluster-verification-events.jsonldeployment.pre_cluster_verification_report_directory, else arm-report\verification\live in the folder that holds provisioning.simplified.evidence_path (else media_path, else the folder of the master file): the toolkit's own ruleThe pre-cluster verification gate's event file (or the folder that holds it: the file name is added). Written by the toolkit's gate next to report.json and summary.md. Without it the Verification mode shows nothing and there are no [verify] log lines. The file is read whole and the latest run in it is shown; a file the gate replaces for a new run is shown as it is now. Relative paths are relative to the config file. Registered in the toolkit's variables registry as tools.sonar.config_keys.Config.verificationEventsPath.
logAccountsobjectnonone{ "local": { "username": "azl-admin" }, "domain": { "netbios": "IIC", "username": "svc-join", "passwordRef": "keyvault://kv-example/svc-join-password" } }identity.local_admin, identity.active_directory (see below)Which account reads a node's logs: local while it is a workgroup machine, domain once the OS configuration has reported both DomainJoined and DomainAdminsConfigured. Names only plus a keyvault://<vault>/<secret>[/<version>] reference; a password is refused. domain.maxRejections (whole number 1 to 5, default 2) is how many rejections the circuit breaker allows before it stops trying the domain account until its password changes, and also the most connection attempts with the domain account in flight at once: set it below the domain's lockout threshold. Edit the file to change it (Set-AzlSonarConfig does not set objects). A reference that is not valid (a plain password, a vault name Azure would not accept, a version that is not 32 hexadecimal characters) is a problem at load, naming logAccounts.domain.passwordRef. See Log access.
updateAccountobjectnonone{ "source": "keyvault", "vault": "kv-example", "usernameSecret": "update-user", "passwordSecret": "update-password", "domain": "example.test" }-The deployment account that reads the cluster's own update service on one node (read-only), so the Update tab shows what the cluster says as it happens and not Azure's delayed answer. See updateAccount. Absent: Sonar reads the Azure update resources only, as before, and the Update tab says that node-side reading is off.
recordPathstringnonone./recordings/clus01.jsonl- (use -Record)Record every run (as -Record, which overrides it).
credential.sourceprompt, parameter, keyvaultnopromptkeyvault- (always prompt)Who supplies the log account: asked at start; -Credential; or Key Vault.
credential.vaultstringwith keyvaultkv-example-Name of the Key Vault that holds the log account (a name, never a value). Needs Az.KeyVault.
credential.usernameSecretstringwith keyvaultlog-user-Name of the secret that holds the user name.
credential.passwordSecretstringwith keyvaultlog-pass-Name of the secret that holds the password.
logs.pathslist of stringsnofive standard foldersC:\MASLogs-Folders tailed on the seed node.
logs.includelist of patternsno*.log, *.txt, *.xml*.log-Which files are followed.
logs.excludelist of patternsno*.etl*.etl-Which files are skipped. May be empty.
logs.recurseDepthinteger 0 to 10no33-Folder levels below each path.
logs.activeWindowMinutesinteger 1 to 10080no3030-Only files written this recently are followed.
logs.maxLinesPerPollinteger 1 to 10000no500500-Lines per log poll; the rest come next poll.
logs.pollSecondsinteger 1 to 3600nopollSeconds10-How often logs are read.
logs.transportauto, winrm, sshnoautossh-How the seed node is reached.
clusterPatternStandard, RackAwarenoStandardRackAware-The This deployment note in the Log access window (what Azure Local needs for that shape).
architecturehyperconverged, disaggregatednohyperconvergeddisaggregated-Same: a note for a SAN (disaggregated) deployment.
internalDnstrue or falsenofalsetrue-Same: a note for Internal DNS (preview, release 2609; Local Identity only; ignored, with a warning, for Active Directory).
trackauto, deployment, update, add-node, repairnoautoupdate-Which operation is followed after the deployment. health is accepted and treated as auto (there is no Health mode).
monitorAuto, Discovery, Provisioning, OsConfiguration, Verification, Validate, Deployment, Update, AddNode, RepairnoAutoOsConfiguration-Which stage to watch. Auto follows the whole flow; one value shows only that tile and reads only the sources it needs. Start-AzlSonar.ps1 -Monitor overrides it. See Run one stage on its own.
updateTrackauto, offnoautooff-off never reads the update resources.
apiVersionstring yyyy-mm-ddno2026-10-01-The ARM version for the cluster and deploymentSettings. Change only if Azure rejects the default.
apiVersionFallbackstring yyyy-mm-ddno2025-10-01-Tried once when Azure rejects apiVersion; Sonar warns when it falls back.
edgeApiVersionstring yyyy-mm-ddno2026-10-01-The ARM version for edge machines and their ProvisionOs job.

credential.password, .secret and .secretValue are refused: secrets never go in the file.

From the master infrastructure.yml ​

-InfrastructureFile (and ConvertTo-AzlSonarConfig) reads the master file (schema 5, azurelocal-toolkit config/variables/) with a small reader built into Sonar. It needs neither the toolkit nor a YAML module. It reads only these keys:

A file cut for ZTP is not enough for Sonar. The ztp cut of the toolkit (New-InfrastructureArtifacts.ps1 -Cut ztp, _metadata.scope: ztp) has no cluster.name and no scenario.identity, and Sonar needs both (the table below marks them required). Use the full master file, or the monitoring template (config/variables/templates/tools/monitoring.yml).

infrastructure.yml (schema 5)Sonar configNotes
_metadata.schema_version(checked)Must be 5.x.
azure.subscription_idsubscriptionIdRequired.
azure.resource_groupresourceGroupRequired.
azure.locationlocationOptional. The region shown in Details in the top bar; Sonar does not use it to reach Azure.
cluster.nameclusterNameRequired. A ZTP-only file (_metadata.scope: ztp) has no cluster section: give it one, or use a config file.
scenario.os_install: simplified or isoprovisioningRoute: simplified or oem-imageRequired.
scenario.identity: active_directory or local_identityidentityModel: ActiveDirectory or LocalIdentityRequired.
nodes[].namenodes[].name
nodes[].network_adapters[] with roles containing management and ip_assignment static or dhcp_reservation: its ip_addressnodes[].addressThe first such port. A team partner with ip_assignment: none is skipped. Files of schema 5.0 and 5.1 without network_adapters use nodes[].management.ip_address.
nodes[].arc_machine_namenodes[].arcMachineNameWhen set.
the first node in nodesnodes[].seed: trueSchema 5.3 has no seed key, so the first listed node is the seed.
identity.local_admin.usernamelogAccounts.local.usernameThe local account that reads a node's logs while it is a workgroup machine (shown as workgroup: using azl-admin). Only the name: the password comes from -Credential, the prompt or credential.source.
identity.active_directory.netbios_namelogAccounts.domain.netbiosActive Directory only. The NETBIOS of the domain account NETBIOS\username that reads a node's logs once the node has reported both DomainJoined and DomainAdminsConfigured.
identity.active_directory.domain_join_account.usernamelogAccounts.domain.usernameActive Directory only. The domain account you supply: it reads a node's logs once the node has reported both DomainJoined and DomainAdminsConfigured. Read defensively: absent is fine (the local account stays).
identity.active_directory.domain_join_account.passwordlogAccounts.domain.passwordRefMust be a keyvault://<vault>/<secret> reference, optionally /<version> (32 hexadecimal characters) to pin the secret version. Sonar reads the secret with Az.KeyVault when the first node needs it, keeps it as a secure string and never shows, logs or records it. A value that is not a valid reference stops the import with a message that names this key and does not repeat the value. See Log access.
identity.active_directory.lcm_user.*(not read)Sonar never reads the LCM user from the master file and never uses it for the domain credential. If lcm_user is the only account in the file, there is no domain account and the local account stays. To read the cluster's own update service as the deployment account, supply it yourself: updateAccount or -UpdateCredential.
provisioning.simplified.evidence_path + discoverydiscoveryPathThe discovery folder inside the evidence folder (run the toolkit's discovery with -OutputPath <evidence_path>\discovery). Set whenever evidence_path is given.
deployment.events_directory + os-configuration-events.jsonl, arm-deployment-events.jsonl and update-events.jsonlosConfigEventsPath, armEventsPath, updateEventsPathThe one events folder the toolkit's OS configuration and ARM runs write to by default (D45). No toolkit script writes update-events.jsonl yet; Sonar reads it when it exists. Without the key: %ProgramData%\AzureLocalToolkit\<cluster.name>\events, the same default the toolkit uses. Environment variables are expanded; a relative path is relative to the folder of the master file. Both routes.
deployment.pre_cluster_verification_report_directoryverificationEventsPathThe gate's report directory. Without the key: arm-report\verification\live in the folder that holds provisioning.simplified.evidence_path, else media_path, else the folder of the master file (the toolkit's rule).
provisioning.simplified.evidence_path + ztp-events.jsonlztpEvents.pathSimplified route only. Without evidence_path, ZTP's default %ProgramData%\AzureLocalZtp\<site_name>\evidence (needs provisioning.simplified.site_name).

Everything else keeps Sonar's defaults. The credential is never taken from the file: it only holds keyvault:// references, which Sonar does not read or resolve. Give the log account with -Credential or answer the prompt. Override the poll interval with -PollSeconds.

Missing or unknown values are reported with the schema path:

text
Infrastructure file (...\infrastructure.yml) does not give Sonar what it needs:
 - azure.resource_group : is missing; Sonar needs the resource group of the cluster (infrastructure.yml, schema 5)
 - scenario.os_install : is 'pxe'; use simplified or iso (infrastructure.yml, schema 5)
 - nodes[1].network_adapters : node 'node02' has no port with roles management, ip_assignment static or dhcp_reservation and an ip_address (infrastructure.yml, schema 5)

What the YAML reader supports and refuses ​

Sonar reads infrastructure.yml with its own small YAML reader (no YAML module, no toolkit). It reads the subset the schema uses:

  • Block maps and block lists (a list may sit at the same indent as its key), flow lists and maps written on one line ([a, b], { k: v }).
  • Plain, 'single' and "double" quoted values on one line. A # starts a comment only after a space, so https://example.com#frag is a value. Keys are always text (712: storage is the key 712).
  • Block scalars | and >, with - or +: blank lines, indentation and # lines inside the block are kept as text.
  • Whole numbers up to 9 digits (not 007) are numbers, 1.5 is a number, true and false are booleans, null and ~ are empty. Everything else, including yes, is text.
  • A --- document start (with or without a comment), a CRLF file and a byte order mark.

It refuses these, with YAML line N: ... (the message names the line, never its text):

  • Duplicate keys in one map.
  • A quoted value, a [ ... ] or a { ... } that continues on the next line (put it on one line, or use a block list or map), and text after a closing quote or bracket.
  • A nested list on one line (- - a), anchors, aliases and tags (&, *, !), block scalar headers with an indentation number (|2).
  • More than one document, or content after ...; tab indentation.
  • Input over 2 MB, and nesting deeper than 40 levels.

updateAccount: the cluster's own update service ​

Azure's update status lags the cluster by many minutes. With updateAccount Sonar also reads the cluster's own update service on one node, over WinRM, read-only (Get-SolutionUpdate, Get-SolutionUpdateRun, Get-SolutionUpdateEnvironment, Get-ClusterNode), and shows what the cluster says as it happens, after a deployment and in a standalone -Monitor Update session. The account must be the deployment account (a domain user), not the local administrator or the domain account that reads the logs. It is optional and off by default.

json
"updateAccount": {
  "source": "keyvault",
  "vault": "kv-example",
  "usernameSecret": "update-user",
  "passwordSecret": "update-password",
  "domain": "example.test"
}
KeyTypeDefaultMeaning
updateAccount.sourcekeyvault, parameterkeyvault when vault is set, else parameterWhere the account comes from: Key Vault, or -UpdateCredential of Start-AzlSonar.ps1.
updateAccount.usernamestringThe account name: user@domain, DOMAIN\user, or a name without a domain (then domain qualifies it). Never a password. When absent, the name is read from usernameSecret.
updateAccount.domainstringAppended as @domain to a name that has no @ and no backslash (the vault often keeps the name without it).
updateAccount.vaultstringThe Key Vault that holds the secrets (a name). Needs Az.KeyVault and an Azure sign-in that can read secrets.
updateAccount.usernameSecretstringThe secret that holds the user name. Needed when username is not set.
updateAccount.passwordSecretstringThe secret that holds the password. It is kept as a SecureString and never shown, logged or recorded.

A password in the file (password, secret, secretValue) is refused. -UpdateCredential (Get-Credential) gives the account without any key (source parameter, or no updateAccount at all). With -InfrastructureFile the master file does not carry this account: give -UpdateCredential, or generate a config file with ConvertTo-AzlSonarConfig and add updateAccount. updateTrack off turns the whole update track off, including this.

Without an account, or when it cannot be read, Sonar keeps its Azure-only behaviour and the Update tab says so in plain words ("Node-side update reading is off ..."). A refused account is never retried per poll: see the update object.

Monitoring a monthly update ​

To follow an update on a cluster that is already running, with no deployment in progress or in its history, a config needs only the target, the seed node and a credential source. Placeholders:

json
{
  "subscriptionId": "00000000-0000-0000-0000-000000000001",
  "resourceGroup": "<resource-group>",
  "clusterName": "<cluster-name>",
  "identityModel": "ActiveDirectory",
  "nodes": [ { "name": "<seed-node-name>", "address": "<seed-node-address>", "seed": true } ],
  "credential": { "source": "prompt" },
  "monitor": "Update"
}

Start it with ./Start-AzlSonar.ps1 -ConfigPath ./config/update.json -Monitor Update -Credential (Get-Credential) (-Monitor Update overrides monitor in the file). identityModel (ActiveDirectory or LocalIdentity) only decides which account reads the node logs. List every node if you want a card per machine; the seed node (seed: true) is the one whose log is read. credential.source can also be keyvault (with vault, usernameSecret, passwordSecret). No ztpEvents, osConfigEventsPath, armEventsPath or discoveryPath is needed, and none is read for this monitor. What the page shows is on Update.

Add updateEventsPath (the toolkit's update-events.jsonl) and -Monitor Update also starts on a machine with no Azure sign-in: Sonar then reads that file only, needs no credential, and marks the Azure live poll as not connected (run it).

Update the configuration ​

Change any one key (without an editor) ​

Set-AzlSonarConfig changes one key of a config file, checks the result with the same rules Sonar applies at start, and refuses (writing nothing, naming the problem) a value that would make the file invalid:

powershell
Import-Module ./src/AzlSonar/AzlSonar.psd1
Set-AzlSonarConfig                                                     # lists every key it can set, its kind and allowed words
Set-AzlSonarConfig -Path ./config/clus01.json -Key pollSeconds -Value 30
Set-AzlSonarConfig -Path ./config/clus01.json -Key identityModel -Value ActiveDirectory
Set-AzlSonarConfig -Path ./config/clus01.json -Key logs.paths -Value 'C:\MASLogs', 'C:\CloudDeployment\Logs'   # a list takes several values
Set-AzlSonarConfig -Path ./config/clus01.json -Key logs.transport -Remove                                      # back to the default
Set-AzlSonarConfig -Path ./config/clus01.json -Key pollSeconds -Value 60 -WhatIf                               # show, do not write

The key is the one in the key reference, not case sensitive. Number keys take a whole number, accessToken and internalDns take true or false. Keys with a fixed list of words take only those words. It refuses secrets (credential.password and the like) and nodes (use Add-AzlSonarNode and Remove-AzlSonarNode). Like those, it rewrites the file as plain JSON, so comments in a hand-commented file are lost: to keep comments, edit the file with an editor and run Test-AzlSonarConfig afterwards. A running Sonar keeps the old value until it is restarted (below).

With the master file there is nothing to set: change infrastructure.yml (the table above says which key feeds which setting).

Add or remove a node ​

  • Master file: add the machine to nodes in infrastructure.yml. The running Sonar logs a notice; restart it to track the node (below).
  • Config file: Add-AzlSonarNode -Path ./config/clus01.json -Name node03 -Address 192.0.2.13 and Remove-AzlSonarNode -Path ... -Name node03. -Seed makes the node the seed node. Removing the seed passes the seed to the first remaining node. These commands rewrite the file as plain JSON, so comments in a hand-commented file are lost.
  • Generated config file: after the master file changes, ConvertTo-AzlSonarConfig -InfrastructureFile ./infrastructure.yml -OutFile ./config/clus01.json -Force. Hand edits in the generated file are replaced.

Change the route or the identity model ​

Master file: scenario.os_install and scenario.identity. Config file: edit provisioningRoute (simplified, oem-image, auto) and identityModel. Restart Sonar. The route decides which provisioning mode and which workers run; the identity model decides the log-account guidance.

Point Sonar at a different cluster ​

Change subscriptionId, resourceGroup and clusterName (master file: azure.subscription_id, azure.resource_group, cluster.name) and the nodes. Or keep one file per cluster and start Sonar with the right -InfrastructureFile or -ConfigPath. Sign in to the subscription first (Connect-AzAccount, Set-AzContext). Restart Sonar.

Move the event files ​

Sonar follows five files written by the other tools. Move one by changing the key that feeds it, then restart Sonar (it reads each file from its start after a restart):

FeedMaster file keyConfig file keyDefault with the master file
ZTP (ztp-events.jsonl)provisioning.simplified.evidence_pathztpEvents.path%ProgramData%\AzureLocalZtp\<site_name>\evidence
OS configuration (os-configuration-events.jsonl)deployment.events_directoryosConfigEventsPath%ProgramData%\AzureLocalToolkit\<cluster.name>\events
ARM Validate and Deploy (arm-deployment-events.jsonl)deployment.events_directoryarmEventsPaththe same events folder
Solution update (update-events.jsonl)deployment.events_directoryupdateEventsPaththe same events folder
Pre-cluster verification (precluster-verification-events.jsonl)deployment.pre_cluster_verification_report_directoryverificationEventsPatharm-report\verification\live next to the evidence folder
Pre-cluster verification Plan (precluster-plan-events.jsonl)deployment.events_directorynone: Sonar looks in the events folder of the other feeds, then in the folder of verificationEventsPaththe same events folder
Hardware discovery (<ServiceTag>.json, discovery-summary.json)provisioning.simplified.evidence_path (the discovery folder in it)discoveryPaththe discovery folder in the evidence folder (on the simplified route ZTP's default evidence folder; on the ISO route only when evidence_path is set)

deployment.events_directory is shared: the toolkit's OS configuration and ARM runs write there by default and Sonar reads there by default, so setting it in the master file moves both sides at once. A toolkit run given -ReportDirectory writes its feed into that report directory unless the key is set; set the key when a pipeline passes -ReportDirectory. With a config file, for example:

powershell
Set-AzlSonarConfig -Path ./config/clus01.json -Key osConfigEventsPath -Value 'D:\Data\azl-events\clus01\os-configuration-events.jsonl'
Set-AzlSonarConfig -Path ./config/clus01.json -Key armEventsPath -Value 'D:\Data\azl-events\clus01\arm-deployment-events.jsonl'

Change the poll interval ​

-PollSeconds 30 on the command line (overrides the file), or pollSeconds in a config file. Log polling follows it unless logs.pollSeconds is set. 5 to 3600.

Change the credential source ​

credential.source in a config file: prompt (asked at start), parameter (use -Credential), or keyvault (with credential.vault, usernameSecret, passwordSecret, names only). With -InfrastructureFile the source is prompt; -Credential always wins over it. To use Key Vault with the master file, generate a config file with ConvertTo-AzlSonarConfig and set credential in it.

What happens to a running Sonar ​

The pollers and the log tailer are built when Sonar starts, so a change to the file does not change a running Sonar. What it does:

  • With -InfrastructureFile: Sonar checks the file's modification time every 60 seconds. When it changed and the node set differs (a node added, removed or at a new address) Sonar writes a notice to the log pane, for example [sonar] The master infrastructure file changed its node set (added: example-n04). Nodes now: ... Restart Sonar to track the change., and keeps running with the nodes it has. A file that cannot be read (for example half saved) is reported once and the old nodes stay in use. Restart Sonar to pick the change up.
  • With -ConfigPath: the file is read once at start. Restart Sonar after editing it.

Live re-reading of the node set (adding pollers without a restart) is not built: it would mean rebuilding the workers around the running page and recording.

The API ​

Two keys change how Sonar's HTTP API answers: accessToken (the per-start token that every route and the page need; false removes the handshake, single-user machines only) and maxEventStreams (how many /api/events streams are served at once; one more gets 429). pollSeconds sets how often the state behind /api/state is refreshed, and monitor decides which parts of it are filled. All routes, fields and examples are in the API reference.

Common mistakes ​

You seeCause and fix
Sonar config (...) is not valid: - subscriptionId must be a GUID.The subscription is a name, not its ID. Use the GUID ((Get-AzContext).Subscription.Id).
nodes must list at least one node.A new file has no nodes: Add-AzlSonarNode.
nodes[0].address is required (host name or IP address).A node has a name but no address.
Only one node can be the seed node (seed: true).Two nodes marked seed. Add-AzlSonarNode -Seed clears the old mark.
identityModel must be LocalIdentity or ActiveDirectory.The config file wants those words; the master file's local_identity and active_directory are converted for you.
credential.password is not allowed: never put secrets in the config.Remove it. Use the prompt, -Credential or Key Vault.
Give -ConfigPath or -InfrastructureFile, not both.Choose one.
Infrastructure file (...) is not valid YAML: YAML line N: ...Tabs, anchors (&, *) and several documents are not supported; the message names the line.
_metadata.schema_version : is '4.2.0'; Sonar reads schema 5.x filesUpgrade the file with the toolkit's migration.
cluster.name : is missingA ZTP-only file has no cluster. Add cluster.name, or use a config file.
... already exists. Use -Force to replace it.New-AzlSonarConfig and ConvertTo-AzlSonarConfig do not overwrite silently.
The new node is not on the pageSonar was not restarted after the file changed (see above).
ZTP lines are missingztpEvents.path (or provisioning.simplified.evidence_path) points to a folder that is not the one ZTP writes to, or Sonar runs on a machine that cannot read it.

Released under the MIT License.