keda icon indicating copy to clipboard operation
keda copied to clipboard

Provide support for SAS token auth in Azure Event Hubs Scaler

Open yaronpri opened this issue 2 years ago • 16 comments

Report

Based on current documentation https://keda.sh/docs/2.6/scalers/azure-event-hub/

  • when defining Azure EventHub Scaler there is no option to use EventHub SAS token (which was generated using: https://docs.microsoft.com/en-us/rest/api/eventhub/generate-sas-token)
  • or pass SAS token for the checkpoint blob storage Both settings expected to get connection string values - which in some cases is not a valid option

Expected Behavior

To have ability to use SAS token

Actual Behavior

Get only connection string

Steps to Reproduce the Problem

  1. Setup EventHub scaler
  2. Try to use SAS token for the EventHub or for Checkpoint blob storage
  3. Only receive connection string

Logs from KEDA operator

No need

KEDA Version

2.5.0

Kubernetes Version

No response

Platform

No response

Scaler Details

No response

Anything else?

No response

yaronpri avatar Mar 02 '22 12:03 yaronpri

Fair request, adding to backlog. Are you willing to contribute this?

tomkerkhove avatar Mar 02 '22 12:03 tomkerkhove

For sure, I will try to find some time for this. Thx

yaronpri avatar Mar 05 '22 15:03 yaronpri

@yaronpri Do you any branch/commit for proving this feature? Would love to help with you

jiujiujiujiujiuaia avatar Apr 02 '22 06:04 jiujiujiujiujiuaia

@v-shenoy If you are bored, is this something you want to pick up?

tomkerkhove avatar Apr 19 '22 13:04 tomkerkhove

@tomkerkhove I can take them (both event hub and service bus) up next week.

v-shenoy avatar Apr 20 '22 10:04 v-shenoy

That would be awesome, but don't feel pressured!

tomkerkhove avatar Apr 20 '22 11:04 tomkerkhove

@tomkerkhove I Can take up this parallelly with https://github.com/kedacore/keda/issues/2920

sushmithavangala avatar Apr 27 '22 11:04 sushmithavangala

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 26 '22 12:06 stale[bot]

Bump

tomkerkhove avatar Jun 27 '22 05:06 tomkerkhove

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 31 '22 00:08 stale[bot]

Hi @SushmithaVReddy is there a plan to add support for this ? I saw that https://github.com/kedacore/keda/issues/2920 (Azure Service Bus) - was closed but this issue is still valid.

yaronpri avatar Nov 24 '22 08:11 yaronpri

is this something you have in progress @v-shenoy ?

JorTurFer avatar Nov 24 '22 22:11 JorTurFer

is this something you have in progress @v-shenoy ?

I was planning to do this. But last I checked the SDK that we use does not support SAS tokens. I am not sure if that has changed.

v-shenoy avatar Nov 25 '22 04:11 v-shenoy

is this something you have in progress @v-shenoy ?

I was planning to do this. But last I checked the SDK that we use does not support SAS tokens. I am not sure if that has changed.

Okay, I am taking a look at the docs, and there is an interface that mentions SAS tokens. I will take a look and send a PR if it's supported.

v-shenoy avatar Nov 25 '22 05:11 v-shenoy

After going through the docs for azure-event-hubs-go/v3, it relies on the azure-amqp-common-go/sas package for a SAS token provider which requires either providing the key name & value, or a connection string with the same format as the one KEDA uses. Not the SAS token format.

@yaronpri Maybe you know more about using the SAS tokens of the form you provided with the SDK that we use in KEDA?

v-shenoy avatar Nov 29 '22 17:11 v-shenoy

Hi @v-shenoy from what I see the way to generate SAS token for EventHub is similar to the way it's generated for ServiceBus. So same concept which was done for ServiceBus could work also for EventHub https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-sas https://learn.microsoft.com/en-us/rest/api/eventhub/generate-sas-token

yaronpri avatar Dec 13 '22 08:12 yaronpri