Skip to content

Add Client Secret support into azure event hub integrations#17245

Merged
kaiyan-sheng merged 27 commits intomainfrom
oauth2-azure
Feb 24, 2026
Merged

Add Client Secret support into azure event hub integrations#17245
kaiyan-sheng merged 27 commits intomainfrom
oauth2-azure

Conversation

@kaiyan-sheng
Copy link
Contributor

@kaiyan-sheng kaiyan-sheng commented Feb 5, 2026

Proposed commit message

Add OAuth2 client secret authentication support for Azure Event Hub integrations
This enhancement adds OAuth2 (client_secret) authentication support to all Azure integrations that use Event Hub, following the implementation in elastic/beats#47256.

Changes include:

  • Added auth_type parameter to select between connection_string (default) and client_secret authentication
  • Added OAuth2 parameters: eventhub_namespace, tenant_id, client_id, client_secret, authority_host
  • Made connection_string and storage_account_key optional (conditionally required based on auth_type)
  • Updated all affected template files to output OAuth2 parameters
  • Version bumped 12 packages with changelog entries

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

Affected 12 packages:

  • azure
  • azure_logs
  • azure_openai
  • azure_functions
  • azure_frontdoor
  • azure_app_service
  • azure_ai_foundry
  • microsoft_sentinel
  • microsoft_defender_cloud
  • m365_defender
  • kubernetes
  • github

How to test this PR locally

Related issues

Screenshots

Screenshot 2026-02-06 at 1 04 34 AM Screenshot 2026-02-10 at 9 57 45 AM

@elastic-vault-github-plugin-prod
Copy link

elastic-vault-github-plugin-prod bot commented Feb 5, 2026

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@kaiyan-sheng kaiyan-sheng marked this pull request as ready for review February 11, 2026 04:44
@kaiyan-sheng kaiyan-sheng requested review from a team as code owners February 11, 2026 04:44
@andrewkroh andrewkroh added Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Team:obs-ds-hosted-services Observability Hosted Services team [elastic/obs-ds-hosted-services] labels Feb 11, 2026
Copy link
Contributor

@zmoog zmoog 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 working on this @kaiyan-sheng, it LGTM overall, no blockers.

IMO there's one aspect to consider.

In variable descriptions we use the internal field names, like auth_type or connection_string.

For example:

Image

I have no problem in matching the UI elements to the internal name, but I see my brain performing a lookup somewhere for a split second.

I and think our users wouldn't find this complicated as well, but maybe we can remove this tiny friction without losing clarity.

What about (1) using actual field names that match the UI and (2) use bold/italics to field highlight dependencies?

CleanShot 2026-02-20 at 09 09 23@2x

Is a subtle difference, but IMO it can smooth over this friction until we get proper var group dependencies in 9.4.

@ishleenk17
Copy link
Member

@claude pls review the PR

@github-actions
Copy link
Contributor

github-actions bot commented Feb 20, 2026

Claude finished @ishleenk17's task in 2m 35s —— View job


PR Review Complete

  • Gather repository context
  • Review existing PR comments and threads (32 total, 2 unresolved)
  • Analyze key changed files
  • Check for security, logic, and best practice issues
  • Submit formal PR review

I've reviewed this PR and submitted my feedback. The implementation looks solid overall.

Summary:

  • ✅ Client secret authentication support is correctly implemented across all 12 Azure Event Hub integrations
  • ✅ Template logic properly emits OAuth2 parameters conditionally
  • ✅ Documentation is comprehensive with clear setup instructions
  • ✅ Changes are backward compatible (existing connection_string auth continues to work)
  • ✅ Changelogs are consistently updated

Minor items noted:

  • There's an unresolved thread from @zmoog about whether auth_type should be required: true
  • The policy tests only cover connection_string path; consider adding client_secret test coverage

No blockers identified - the PR is in good shape for merge.

--- | View PR review


Why is Claude responding? | Type @claude to interact further

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This PR adds client secret authentication support across 12 Azure Event Hub integrations. The implementation is well-structured and consistent across packages. A few observations:

Overall Quality

  • The implementation follows the pattern from beats PR #47256 correctly
  • Documentation is comprehensive with clear setup instructions for both authentication methods
  • The template logic properly conditionally emits authority_host only when auth_type is client_secret
  • Changelogs are consistently updated across all 12 packages

Minor Considerations

  1. Unresolved Review Thread: There's an unresolved comment from @zmoog asking whether auth_type should be required: true (currently required: false with default connection_string). While the current approach maintains backward compatibility, making it required would be more explicit. Worth discussing.

  2. Test Coverage: The policy tests for m365_defender only cover the connection_string path. Consider adding a test case for client_secret auth to verify the template correctly outputs the OAuth2 parameters and omits connection_string/storage_account_key.

  3. Pre-existing Issue (out of scope for this PR): The packages/github/data_stream/audit/agent/stream/azure-eventhub.yml.hbs file uses filebeat-graphactivitylogs-{{eventhub}} as the default container name, which appears to be copy-pasted from the azure graphactivitylogs template. This is a pre-existing issue not introduced by this PR.

No Blockers - The PR is ready to merge from a technical standpoint. The implementation is solid and the changes are backward compatible.


Why is Claude responding? | Type @claude to interact further

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@kaiyan-sheng
Copy link
Contributor Author

kaiyan-sheng commented Feb 22, 2026

What about (1) using actual field names that match the UI and (2) use bold/italics to field highlight dependencies?

@zmoog Good point! I think this is definitely worth improving. I'm changing them to use the actual parameter names in the UI instead of names in Filebeat!

But for the README files I see we are using param names from Filebeat:
Screenshot 2026-02-22 at 1 12 44 AM

Do you think it's worth changing too?

@kaiyan-sheng kaiyan-sheng self-assigned this Feb 23, 2026
@efd6
Copy link
Contributor

efd6 commented Feb 23, 2026

/test

@elasticmachine
Copy link

💚 Build Succeeded

History

cc @kaiyan-sheng

@zmoog
Copy link
Contributor

zmoog commented Feb 23, 2026

Do you think it's worth changing too?

Yeah, makes sense.

We should probably align this section with what we have at https://www.elastic.co/docs/reference/integrations/azure/events, adding the new options in the "Event Hub Processor v2 only" seciton.

@kaiyan-sheng
Copy link
Contributor Author

adding the new options in the "Event Hub Processor v2 only" seciton.

@zmoog and I talked about this in slack, the decision is to keep the new options with authentication section so all the params around auth are together.

Also I see some benefits of keeping the config parameters in documentation instead of the UI names when we are trying to debug using config files instead of UI. So I think we can keep it as is for now (tbh maybe we should document both the UI name and the param name).

@kaiyan-sheng kaiyan-sheng merged commit 5591fd4 into main Feb 24, 2026
12 checks passed
@kaiyan-sheng kaiyan-sheng deleted the oauth2-azure branch February 24, 2026 08:18
@elastic-vault-github-plugin-prod

Package azure - 1.36.0 containing this change is available at https://epr.elastic.co/package/azure/1.36.0/

@elastic-vault-github-plugin-prod

Package azure_ai_foundry - 0.9.0 containing this change is available at https://epr.elastic.co/package/azure_ai_foundry/0.9.0/

@elastic-vault-github-plugin-prod

Package azure_app_service - 1.1.0 containing this change is available at https://epr.elastic.co/package/azure_app_service/1.1.0/

@elastic-vault-github-plugin-prod

Package azure_frontdoor - 2.3.0 containing this change is available at https://epr.elastic.co/package/azure_frontdoor/2.3.0/

@elastic-vault-github-plugin-prod

Package azure_functions - 0.12.0 containing this change is available at https://epr.elastic.co/package/azure_functions/0.12.0/

@elastic-vault-github-plugin-prod

Package azure_logs - 0.6.0 containing this change is available at https://epr.elastic.co/package/azure_logs/0.6.0/

@elastic-vault-github-plugin-prod

Package azure_openai - 1.11.0 containing this change is available at https://epr.elastic.co/package/azure_openai/1.11.0/

@elastic-vault-github-plugin-prod

Package github - 2.22.0 containing this change is available at https://epr.elastic.co/package/github/2.22.0/

@elastic-vault-github-plugin-prod

Package kubernetes - 1.85.0 containing this change is available at https://epr.elastic.co/package/kubernetes/1.85.0/

@elastic-vault-github-plugin-prod

Package m365_defender - 5.9.0 containing this change is available at https://epr.elastic.co/package/m365_defender/5.9.0/

@elastic-vault-github-plugin-prod

Package microsoft_defender_cloud - 3.3.0 containing this change is available at https://epr.elastic.co/package/microsoft_defender_cloud/3.3.0/

@elastic-vault-github-plugin-prod

Package microsoft_sentinel - 1.3.0 containing this change is available at https://epr.elastic.co/package/microsoft_sentinel/1.3.0/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. Integration:azure_ai_foundry Microsoft Foundry Integration:azure_app_service Azure App Service Integration:azure_frontdoor Azure Frontdoor (Community supported) Integration:azure_functions Azure Functions Integration:azure_logs Custom Azure Logs Integration:azure_openai Azure OpenAI Integration:azure Azure Logs Integration:github GitHub Integration:kubernetes Kubernetes Integration:m365_defender Microsoft Defender XDR Integration:microsoft_defender_cloud Microsoft Defender for Cloud Integration:microsoft_sentinel Microsoft Sentinel Team:obs-ds-hosted-services Observability Hosted Services team [elastic/obs-ds-hosted-services] Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Azure] Add client secret (Oauth2) support

8 participants