Skip to content

feat(inputs.azure_monitor): Support secrets for client_secret#18744

Merged
skartikey merged 7 commits into
influxdata:masterfrom
superguillen:feat-azure_monitor---add-Add-Secret-support
May 14, 2026
Merged

feat(inputs.azure_monitor): Support secrets for client_secret#18744
skartikey merged 7 commits into
influxdata:masterfrom
superguillen:feat-azure_monitor---add-Add-Secret-support

Conversation

@superguillen
Copy link
Copy Markdown
Contributor

@superguillen superguillen commented Apr 19, 2026

Summary

Checklist

Related issues

resolves #18743

Use config.Secret for client_secret to support secret stores.
Follows pattern from mysql plugin.
- Add TestInit_NoClientID and TestInit_NoTenantID tests
- Update Gather tests to resolve config.Secret before use
- Follow pattern from telegraf-private
Validate subscription_id, client_id, and tenant_id are not empty
before initializing the Azure client. Use errors.New for consistency
with other telegraf plugins.
@superguillen superguillen changed the title Feat azure monitor add secret support feat(inputs.azure_monitor): add secret store support for client_secret field Apr 19, 2026
@telegraf-tiger telegraf-tiger Bot added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Apr 19, 2026
@srebhan srebhan changed the title feat(inputs.azure_monitor): add secret store support for client_secret field feat(inputs.azure_monitor): Support secrets for client_secret Apr 22, 2026
Copy link
Copy Markdown
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution @superguillen! Please find my comments in the code.

Comment thread plugins/inputs/azure_monitor/azure_monitor.go Outdated
Comment thread plugins/inputs/azure_monitor/azure_monitor.go Outdated
Comment thread plugins/inputs/azure_monitor/azure_monitor_test.go Outdated
@srebhan srebhan self-assigned this Apr 22, 2026
Copy link
Copy Markdown
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Nice. Thanks @superguillen!

@srebhan srebhan added area/azure Azure plugins including eventhub_consumer, azure_storage_queue, azure_monitor ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. labels Apr 28, 2026
@srebhan srebhan assigned skartikey and unassigned srebhan Apr 28, 2026
Copy link
Copy Markdown
Contributor

@skartikey skartikey left a comment

Choose a reason for hiding this comment

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

@superguillen Thanks! Please take a look at the comments.

Comment thread plugins/inputs/azure_monitor/azure_monitor.go Outdated
Comment thread plugins/inputs/azure_monitor/azure_monitor.go
Comment thread plugins/inputs/azure_monitor/azure_monitor_test.go Outdated
Scope client_id and tenant_id checks to the client_secret path so
DefaultAzureCredential setups (managed identity, workload identity,
env credentials, Azure CLI) keep working without those fields.

Document secret-store support for client_secret in README and
sample.conf, and consolidate duplicate mock branches in the metric
definitions client test.
@telegraf-tiger
Copy link
Copy Markdown
Contributor

@skartikey
Copy link
Copy Markdown
Contributor

@superguillen Thanks for the contribution!

@skartikey skartikey merged commit 2ae0d36 into influxdata:master May 14, 2026
27 checks passed
@github-actions github-actions Bot added this to the v1.39.0 milestone May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/azure Azure plugins including eventhub_consumer, azure_storage_queue, azure_monitor feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add secret support to azure_monitor

3 participants