Skip to content

feat: add endpoint suffix override support for azure#14986

Merged
Kavindu-Dodan merged 7 commits intoelastic:mainfrom
Kavindu-Dodan:feat/azure-override-suffix
Aug 22, 2025
Merged

feat: add endpoint suffix override support for azure#14986
Kavindu-Dodan merged 7 commits intoelastic:mainfrom
Kavindu-Dodan:feat/azure-override-suffix

Conversation

@Kavindu-Dodan
Copy link
Contributor

@Kavindu-Dodan Kavindu-Dodan commented Aug 19, 2025

Proposed commit message

Introduce endpoint_suffix configurations for Azure integrations so that the EndpointSuffix of the Connection String can be overridden based on the deployment environment.

Default - core.windows.net
Possible overdding options :

  • US Gov : core.usgovcloudapi.net

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

Screenshots

image

@Kavindu-Dodan Kavindu-Dodan requested review from a team as code owners August 19, 2025 20:31
@Kavindu-Dodan Kavindu-Dodan force-pushed the feat/azure-override-suffix branch 2 times, most recently from 1e209d0 to 8cbd589 Compare August 19, 2025 20:34
@Kavindu-Dodan Kavindu-Dodan requested a review from zmoog August 19, 2025 20:34
@elastic-vault-github-plugin-prod
Copy link

elastic-vault-github-plugin-prod bot commented Aug 19, 2025

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@andrewkroh andrewkroh added Integration:azure_logs Custom Azure Logs Integration:azure Azure Logs documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. 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] labels Aug 20, 2025
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.

Looks good overall!

We need to make some changes because the "endpoint suffix" only works with the processor v2, and the only integration that allows using the processor v2 is the one named “Collect all Azure Logs (v2 preview)”.

Here's a screenshot with a few comments.

Image

@andrewkroh andrewkroh removed the Integration:azure_logs Custom Azure Logs label Aug 20, 2025
@Kavindu-Dodan Kavindu-Dodan requested a review from zmoog August 20, 2025 13:40
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

# Conflicts:
#	packages/azure/changelog.yml

# Conflicts:
#	packages/azure/changelog.yml
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
@Kavindu-Dodan Kavindu-Dodan force-pushed the feat/azure-override-suffix branch from 07bfcaf to c3cd7d1 Compare August 20, 2025 13:42
@Kavindu-Dodan
Copy link
Contributor Author

@zmoog thanks for the review. I have now focused this change only for Azure V2 stream. Please have a look when you have time.

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.

It's okay to add the parameter to the azure_logs input package because it supports the v2 processor.

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.

Sorry for not being more precise in the previous comments.

We should add the endpoint_suffix config option to all integrations that support the v2 processor.

For the azure package, it's only needed in packages/azure/data_stream/events. But adding it to azure_logs package as well is a great idea—I hadn't thought of that initially.

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
@Kavindu-Dodan Kavindu-Dodan requested a review from zmoog August 20, 2025 15:47
@Kavindu-Dodan
Copy link
Contributor Author

@zmoog thanks for the review 🙏

Agree on the suggestion to add this to Custom Azure Logs as it utilizes V2 stream.

@andrewkroh andrewkroh added the Integration:azure_logs Custom Azure Logs label Aug 20, 2025
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! Taking a test drive on my local env.

Kavindu-Dodan and others added 2 commits August 20, 2025 09:48
Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
@Kavindu-Dodan Kavindu-Dodan enabled auto-merge (squash) August 20, 2025 16:49
@Kavindu-Dodan
Copy link
Contributor Author

Thanks! Taking a test drive on my local env.

Thank you and I have enabled auto-merge :) I will loop back if you see the need for more changes.

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.

We only need a small fix to the policy template.

I applied it locally, and here's two snippets of the policy with the default value, and with the custom suffix:

# default: core.windows.net
inputs:
  - id: azure-eventhub-events-f55b8918-08b3-4ed4-a710-6a7d4f5e6af6
    name: azure-1
    revision: 4
    type: azure-eventhub
    use_output: default
    meta:
      package:
        name: azure
        version: 1.28.5
    data_stream:
      namespace: default
    package_policy_id: f55b8918-08b3-4ed4-a710-6a7d4f5e6af6
    streams:
      - id: azure-eventhub-azure.events-f55b8918-08b3-4ed4-a710-6a7d4f5e6af6
        data_stream:
          dataset: azure.events
          type: logs
          elasticsearch:
            dynamic_dataset: true
            dynamic_namespace: true
        connection_string: ${SECRET_0}
        storage_account_container: filebeat-events-myeventhub
        eventhub: myeventhub
        consumer_group: $Default
        storage_account: mystorageaccount
        storage_account_key: ${SECRET_1}
        storage_account_connection_string: >-
          DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=${SECRET_1};EndpointSuffix=core.windows.net
        processor_version: v2
        processor_update_interval: 10s
        processor_start_position: earliest
        partition_receive_timeout: 5s
        partition_receive_count: 100
        tags:
          - azure-eventhub
          - forwarded
        publisher_pipeline.disable_host: true
        sanitize_options: null
# custom: core.usgovcloudapi.net
inputs:
  - id: azure-eventhub-events-f55b8918-08b3-4ed4-a710-6a7d4f5e6af6
    name: azure-1
    revision: 5
    type: azure-eventhub
    use_output: default
    meta:
      package:
        name: azure
        version: 1.28.5
    data_stream:
      namespace: default
    package_policy_id: f55b8918-08b3-4ed4-a710-6a7d4f5e6af6
    streams:
      - id: azure-eventhub-azure.events-f55b8918-08b3-4ed4-a710-6a7d4f5e6af6
        data_stream:
          dataset: azure.events
          type: logs
          elasticsearch:
            dynamic_dataset: true
            dynamic_namespace: true
        connection_string: ${SECRET_0}
        storage_account_container: filebeat-events-myeventhub
        eventhub: myeventhub
        consumer_group: $Default
        storage_account: mystorageaccount
        storage_account_key: ${SECRET_1}
        storage_account_connection_string: >-
          DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=${SECRET_1};EndpointSuffix=core.usgovcloudapi.net
        processor_version: v2
        processor_update_interval: 10s
        processor_start_position: earliest
        partition_receive_timeout: 5s
        partition_receive_count: 100
        tags:
          - azure-eventhub
          - forwarded
        publisher_pipeline.disable_host: true
        sanitize_options: null

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
@Kavindu-Dodan Kavindu-Dodan requested a review from zmoog August 20, 2025 17:53
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.

Now the policy template for the azure and azure_logs packages render correctly.

storage_account_key: {{storage_account_key}}
{{#if endpoint_suffix}}
storage_account_connection_string: DefaultEndpointsProtocol=https;AccountName={{storage_account}};AccountKey={{storage_account_key}};EndpointSuffix={{endpoint_suffix}}
{{else}}
Copy link
Contributor

Choose a reason for hiding this comment

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

As the default value is set already for the endpoint_suffix config. Is it okay to remove the else condition? WDYT?
Consider making the endpoint_suffix required:true when removing the else loop.
This is applicable to the azure_logs as well.

Copy link
Contributor Author

@Kavindu-Dodan Kavindu-Dodan Aug 21, 2025

Choose a reason for hiding this comment

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

@muthu-mps good point. I added the default value to show what we use internally. So it makes sense to make it mandatory and keep the default in the UI along with simple logic internally.

Added this change with 309ff31 :)

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
@elasticmachine
Copy link

💚 Build Succeeded

History

@elastic-sonarqube
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

Copy link
Contributor

@muthu-mps muthu-mps left a comment

Choose a reason for hiding this comment

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

LGTM!

@Kavindu-Dodan Kavindu-Dodan merged commit a42884a into elastic:main Aug 22, 2025
8 of 9 checks passed
@elastic-vault-github-plugin-prod

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

@elastic-vault-github-plugin-prod

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

@andrewkroh andrewkroh added the enhancement New feature or request label Sep 3, 2025
tehbooom pushed a commit to tehbooom/integrations that referenced this pull request Nov 19, 2025
* feat: add endpoint suffix override support for azure

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

# Conflicts:
#	packages/azure/changelog.yml

# Conflicts:
#	packages/azure/changelog.yml

* review changes

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

* review changes

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>

* Update packages/azure_logs/manifest.yml

Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>

* Update packages/azure/data_stream/events/manifest.yml

Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>

---------

Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
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. enhancement New feature or request Integration:azure_logs Custom Azure Logs Integration:azure Azure Logs 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]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants