Add manage grafana command#260
Merged
Merged
Conversation
Adds infrastructure lifecycle management for Azure Managed Grafana to grafanactl, aims at replacing Bicep-based provisioning. The new command creates/updates the Grafana resource and discovers all Azure Monitor Workspaces across subscriptions via Azure Resource Graph, reconciling them as datasource integrations.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new grafanactl manage reconcile workflow intended to manage Azure Managed Grafana lifecycle and reconcile Azure Monitor Workspace integrations using Azure Resource Graph, and wires a corresponding pipeline step type/schema to represent this action.
Changes:
- Adds a new
manage reconcilecommand with flags/validation and runtime wiring to create/update a Managed Grafana resource and reconcile Azure Monitor Workspace integrations. - Introduces Azure Resource Graph–based discovery and a Managed Grafana create/update helper in the internal Azure layer.
- Extends pipeline step types + JSON schema to include a
GrafanaReconcilestep, and updates Go dependencies accordingly.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/grafanactl/internal/azure/utils.go | Adds SafeString helper for nil-safe string dereferencing. |
| tools/grafanactl/internal/azure/monitor.go | Adds Resource Graph discovery client for Azure Monitor Workspace IDs. |
| tools/grafanactl/internal/azure/grafana.go | Fixes client creation error text; adds create/update helper for Managed Grafana. |
| tools/grafanactl/cmd/manage/options.go | Adds reconcile options, flags, validation, and client initialization. |
| tools/grafanactl/cmd/manage/cmd.go | Implements manage reconcile command behavior and integration reconciliation. |
| tools/grafanactl/go.mod | Adds Resource Graph SDK dependency and bumps several module versions. |
| tools/grafanactl/go.sum | Updates dependency checksums for the new/updated modules. |
| pipelines/types/resourcegroup.go | Enables unmarshalling of the new GrafanaReconcile step action. |
| pipelines/types/pipeline.schema.v1.json | Defines and wires the grafanaReconcileStep schema. |
| pipelines/types/common.go | Adds GrafanaReconcileStep type + action constant. |
| go.work.sum | Updates workspace sums due to dependency changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
14 tasks
geoberle
reviewed
Jun 30, 2026
Filter the AMWs by aroHCPPurpuse tag. Also allow managing tags via step definition. Filter the AMWs in manage as well.
ae467fa to
40e99dc
Compare
868c6b9 to
731dad7
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
geoberle
reviewed
Jun 30, 2026
14 tasks
Collaborator
Author
|
This enables Azure/ARO-HCP#5843 |
raelga
approved these changes
Jul 1, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
geoberle
approved these changes
Jul 1, 2026
| flags.StringVar(&opts.GrafanaResourceID, "grafana-resource-id", opts.GrafanaResourceID, "Azure Managed Grafana instance resource ID") | ||
| flags.StringVar(&opts.OutputFormat, "output", opts.OutputFormat, "Output format: table or json") | ||
| flags.BoolVar(&opts.DryRun, "dry-run", opts.DryRun, "Print actions without executing them") | ||
| flags.DurationVar(&opts.Timeout, "timeout", opts.Timeout, "Timeout for the operation") |
Comment on lines
+98
to
+101
| if o.ZoneRedundancy != "Enabled" && o.ZoneRedundancy != "Disabled" { | ||
| return nil, fmt.Errorf("--zone-redundancy must be 'Enabled' or 'Disabled', got: %s", o.ZoneRedundancy) | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://redhat.atlassian.net/browse/ARO-28040
Adds infrastructure lifecycle management for Azure Managed Grafana to grafanactl, aims at replacing Bicep-based provisioning. The new command creates/updates the Grafana resource and discovers all Azure Monitor Workspaces across subscriptions via Azure Resource Graph and filters to only concern the HCP ones. It will them reconciling them as datasource integrations.