Unhandled exception. System.ArgumentException: The connection string used for an Event Hub client must specify the Event Hubs namespace host, and either a Shared Access Key (both the name and value) or Shared Access Signature to be valid

After getting some error that looks like this.  Basically you're using an ROOT access key that don't come with eventhub name. Probably use another constructor if you're using root managed connection string.

-----


Unhandled exception. System.ArgumentException: The connection string used for an Event Hub client must specify the Event Hubs namespace host, and either a Shared Access Key (both the name and value) or Shared Access Signature to be valid. The path to an Event Hub must be included in the connection string or specified separately. (Parameter 'connectionString')
at Azure.Messaging.EventHubs.EventHubsConnectionStringProperties.Validate(String explicitEventHubName, String connectionStringArgumentName)
at Azure.Messaging.EventHubs.Primitives.EventProcessor`1..ctor(Int32 eventBatchMaximumCount, String consumerGroup, String connectionString, String eventHubName, EventProcessorOptions options)
at Azure.Messaging.EventHubs.EventProcessorClient..ctor(BlobContainerClient checkpointStore, String consumerGroup, String connectionString, String eventHubName, EventProcessorClientOptions clientOptions)
at Azure.Messaging.EventHubs.EventProcessorClient..ctor(BlobContainerClient checkpointStore, String consumerGroup, String connectionString, EventProcessorClientOptions clientOptions)
at StandardConsumer.QueueWorker.ExecuteAsync(CancellationToken stoppingToken) in /home/vsts/work/1/s/src/SampleConsumer/QueueWorker.cs:line 46
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at Microsoft.AspNetCore.Builder.WebApplication.Run(String url)
at Program.<Main>$(String[] args) in /home/vsts/work/1/s/src/SampleConsumer/Program.cs:line 17


Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm