[8.19](backport #47256) [Azure] Add client secret (Oauth2) support for eventhub filebeat input#48142
Conversation
|
Cherry-pick of 7ffcd63 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
|
Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services) |
🤖 GitHub commentsJust comment with:
|
belimawr
left a comment
There was a problem hiding this comment.
@kaiyan-sheng is it intentional not to document it in 8.19?
|
Hey @belimawr 👋 It's not 😄 The doc is in a diff file for 8.19 branch I think. I will make the change and push it into the next commit! |
Yeah, 8.19 is still using the old asciidoc system, so when backporting PRs docs need to be manually migrated to the old system. |
Proposed commit message
This PR is to enhance Azure Event Hub input plugin for Elastic Agent with RBAC authorization (OAuth2) due to security requirements. Previously we only support shared access key (with connection string) for authentication.
The implementation added a new config parameter called
auth_typefor users to specify authentication method:When
auth_typeis set toconnection_string, or leave it blank:connection_string is required. Whenauth_typeis set toclient_secret`, oauth2 is used.Note: We do expect users to use the same auth type for both eventhub and storage account.
OAuth2 specific Configuration Parameters (
auth_type=client_secret)When using OAuth2 authentication, the following parameters are required:
eventhub_namespace: Fully qualified namespace (e.g.,namespace.servicebus.windows.net)tenant_id: Azure AD tenant IDclient_id: Azure AD application (client) IDclient_secret: Azure AD application client secretauthority_host: Azure AD authority host (optional, defaults to Azure Public Cloud)https://login.microsoftonline.comis the default.Checklist
./changelog/fragmentsusing the changelog tool.Disruptive User Impact
N/A
How to test this PR locally
Setups on Azure side
OR
Instead of getting storage account connection string, assign storage account role:
When no
connection_stringis specified and noauth_typeis specified:We get error log when starting Filebeat:
testing backwards compatibility:
Without
auth_typespecified, by default we are usingconnection_stringto keep backwards compatible. This config still works.testing with oauth2 for both eventhub and SA:
Screenshots
I can see logs getting ingested from Eventhub to elasticsearch with Filebeat:

Logs
I see this in the filebeat log when testing: