Skip to content

fix(monitoring): use $VAR syntax for Azure Monitor client secret - #91

Merged
hakan-persson merged 1 commit into
mainfrom
fix/grafana-azmon-env-syntax
Jul 26, 2026
Merged

fix(monitoring): use $VAR syntax for Azure Monitor client secret#91
hakan-persson merged 1 commit into
mainfrom
fix/grafana-azmon-env-syntax

Conversation

@hakan-persson

Copy link
Copy Markdown
Member

Summary

  • Follow-up to feat(monitoring): add Azure Monitor datasource for shared Postgres #89. Post-merge live verification found the datasource registered in Grafana but failing its health check: error getting credentials: unable to instantiate credentials, clientSecret must be set.
  • Root cause: $__env{AZURE_CLIENT_SECRET} interpolation in secureJsonData never resolved, even though the env var was confirmed present in the Grafana container on a fresh pod boot (checked via kubectl exec ... env). Switching to the plain $AZURE_CLIENT_SECRET form (Grafana's other documented env-interpolation syntax) fixed it immediately.

Test plan

  • Patched the live datasource ConfigMap directly + triggered a manual provisioning reload to confirm the fix before committing.
  • Health check now returns: "1. Successfully connected to Azure Monitor endpoint. ... 3. Successfully connected to Azure Resource Graph endpoint."
  • Post-merge: confirm same result via the normal ArgoCD-managed rollout.

🤖 Generated with Claude Code

$__env{AZURE_CLIENT_SECRET} registered the datasource but never
actually resolved the secret (Grafana health check kept returning
"clientSecret must be set" even though the env var was confirmed
present in the container on a fresh pod boot). Switching to the
plain $VARNAME interpolation form fixed it — verified live via
the datasource health check (Azure Monitor + Resource Graph both
connect successfully now).
Copilot AI review requested due to automatic review settings July 26, 2026 11:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the monitoring stack’s Grafana provisioning values to ensure the Azure Monitor datasource can resolve its client secret from the Grafana container environment at runtime, restoring datasource health checks for Azure Monitor / Resource Graph.

Changes:

  • Switch Azure Monitor datasource secureJsonData.clientSecret interpolation from $__env{AZURE_CLIENT_SECRET} to $AZURE_CLIENT_SECRET in Grafana Helm values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hakan-persson
hakan-persson merged commit 0d5bf87 into main Jul 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants