@Mahendra Sawarkar - Thanks for the question and using MS Q&A platform.
Based on the information you provided, I can answer your questions as follows:
The SharedAccessKey is not a SAS token, but it is used to create a SAS token. The SAS token is generated by the Azure Event Hubs service when a client authenticates with the service using the SharedAccessKey. The SAS token is then used by the client to access the Event Hub.
In this flow, the SAS token is created by the Azure Event Hubs service when the client authenticates with the service using the SharedAccessKey. The SAS token is then sent to the client, which uses it to access the Event Hub.
This flow is a recommended way of authenticating with Azure Event Hubs using SAS policy.
RBAC is an alternative way of authenticating with Azure Event Hubs. When using RBAC, you would create an Azure AD application and assign it the necessary permissions to access the Event Hub. The connection string would then include the client ID and client secret of the Azure AD application, instead of the SharedAccessKeyName and SharedAccessKey. Here is an example of a connection string using RBAC:
Endpoint=sb://uniqname.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=AHDFHAWEFJASDFHAEFRMVMBCb4N6t+ASDKFKAEJFJASDF=;EntityPath=uniqueeventhubname;SharedAccessSignature=SharedAccessSignature sr=uniqname.servicebus.windows.net&sig=xxxxxx&se=xxxxxx&skn=RootManageSharedAccessKey
- The ideal way of communicating with Azure Event Hubs depends on your specific use case and requirements. Both SAS policy and RBAC are valid ways of authenticating with Azure Event Hubs, and you should choose the one that best fits your needs.
For more details, refer to Acessing Event Hubs with Confluent Kafka Library.
I hope this helps! Let me know if you have any more questions.