How to use read_kafka() SQL with secret()?

rak_haq
New Contributor III

Hi,

I want to read data from the Azure Event Hub using SQL.

Can someone please give me an executable example where you can also use the connection string from the event hub using the SQL function secret(), for example?

This is what i tried but it Databricks can not create a KafkaAdmin:

 

SELECT

cast(value as STRING) as raw_json,

current_timestamp() as processing_time

FROM read_kafka(

bootstrapServers => 'host:9093',

subscribe => 'mytopic',

`kafka.sasl.jaas.config` => secret('scope', 'secret')

)

LIMIT 10