-1

How do I stream event hub data into a spark dataframe with below details:

  1. Service Principal
  2. Event hub namespace
  3. Event hub name
  4. Consumer group

I need to get data into spark dataframe. I do not have event hub connection string.

  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Oct 29 '21 at 07:54

1 Answers1

0

One of the workaround is as follows

Step 1 : Generate the connection string using either of the below commands.

  • Getting the connection string with Azure CLI

    az eventhubs namespace authorization-rule keys list --resource-group MYRESOURCEGROUP --namespace-name MY
    
  • Getting the connection string with Azure PowerShell

    Get-AzEventHubKey -ResourceGroupName MYRESOURCEGROUP -NamespaceName MYEHUBNAMESPACE -Aut
    

Step 2 : Then, For reading the data you can follow either of the examples Example1 ,Example2.

REFERENCES:

Event Hubs get Connection String · MicrosoftDocs

SwethaKandikonda
  • 7,513
  • 2
  • 4
  • 18