An Azure software development kit that facilitates building applications that connect to Azure IoT services.
Hello @gugulothu shiva
From the screenshot, the important part of the error is:
AuthenticationError('CBS Token authentication failed...')
This indicates that your Event Processor is reaching the IoT Hub built-in Event Hubs-compatible endpoint, but authentication to that endpoint is failing. I would troubleshoot the credentials/endpoint configuration first rather than AnyLogic itself.
For IoT Hub, make sure you're using the Event Hubs-compatible endpoint information, not the normal IoT Hub device connection string. IoT Hub exposes its built-in endpoint so that standard Event Hubs SDKs can consume device-to-cloud messages.
In the Azure portal, go to:
IoT Hub → Built-in endpoints → Events
Verify the following values against your application configuration:
- Event Hub-compatible name
- Event Hub-compatible endpoint
- Consumer group - you're currently using $Default
- Shared access policy/key being used by the consumer
Also make sure the SAS policy has Service Connect/Listen permission. Event consumers need authorization to receive events; incorrect SAS credentials or permissions can result in authentication failures.
One thing I'd specifically check in your code is the Event Hub name. A CBS Token authentication failed error can occur when the Event Hub name passed to the SDK is incorrect. Microsoft Q&A has documented cases where changing the value from a namespace/path to only the Event Hub name resolved this exact error.
For example, conceptually:
consumer = EventHubConsumerClient.from_connection_string(
conn_str="<IoT Hub Event Hubs-compatible connection string>",
consumer_group="$Default",
eventhub_name="<Event Hub-compatible name>"
)
Don't use the IoT Hub name automatically as eventhub_name; use the Event Hub-compatible name shown under Built-in endpoints.
I would also check IoT Hub → Networking. If IP filtering is configured and Apply IP filters to the built-in endpoint is enabled, the machine/service running your consumer must originate from an allowed address. Microsoft notes that blocked access to the built-in endpoint can result in an unauthorized response.
If this still fails, please share the relevant connection code with the SharedAccessKey/SAS token removed, along with the Event Hub-compatible name and whether you're using SAS or Microsoft Entra authentication. That should help us identify exactly where the authentication mismatch is occurring.
Sharing these references with you:
Microsoft – Understand Azure IoT Hub endpoints
Microsoft – Event Hubs authentication troubleshooting
Microsoft – IoT Hub IP filtering
Please "Accept the Answer" if this information helped you. This will help us and others in the community.