Error 401 SubCode=40103: Invalid authorization token signature when sending to Azure Event Hub

Lenz, Philipp 20 Reputation points MVP
2025-08-17T15:13:31.5033333+00:00

I am unable to send messages to my Azure Event Hub. Every attempt results in the following error:

401 SubCode=40103: Invalid authorization token signature

Details of my setup:

Event Hubs Namespace: streaming

Event Hub name: stream1

Resource Group: streaming

Shared Access Policy: ps-send2 (Send rights)

Key: Primary key retrieved from the portal/CLI

Public network access: Enabled

DefaultAction: Allow

Local authentication: Enabled (disableLocalAuth = false)

Troubleshooting already performed:

Verified that the SAS policy exists and has Send rights.

Created a new authorization rule (ps-send2) and used the new primary key.

Ensured system clock is correct (UTC).

Verified networking: public access enabled, no IP restrictions.

Tried both lowercased and exact resource URI in the SAS token (https://streaming.servicebus.windows.net/stream1).

  • Still consistently receiving the same error (40103).I am unable to send messages to my Azure Event Hub. Every attempt results in the following error:
      401
    
    Details of my setup:
    • Event Hubs Namespace: streaming
    • Event Hub name: stream1
    • Resource Group: streaming
    • Shared Access Policy: ps-send2 (Send rights)
    • Key: Primary key retrieved from the portal/CLI
    • Public network access: Enabled
    • DefaultAction: Allow
    • Local authentication: Enabled (disableLocalAuth = false)
    Troubleshooting already performed:
    • Verified that the SAS policy exists and has Send rights.
    • Created a new authorization rule (ps-send2) and used the new primary key.
    • Ensured system clock is correct (UTC).
    • Verified networking: public access enabled, no IP restrictions.
    • Tried both lowercased and exact resource URI in the SAS token (https://streaming.servicebus.windows.net/stream1).
    • Still consistently receiving the same error (40103).
Azure Event Hubs
{count} votes

Accepted answer
  1. Smaran Thoomu 29,415 Reputation points Microsoft External Staff Moderator
    2025-08-25T17:41:23.4766667+00:00

    Hi Lenz, Philipp
    Thanks for sharing the error details. The failure was not due to network or authentication policy but specifically how the SAS token was generated.

    Key points checked

    • The Event Hub namespace and entity names were correct.
    • Firewall/VNet restrictions were not in place.
    • The SAS key itself was valid.

    Root cause

    The resource URI included in the SAS token did not exactly match the Event Hub namespace/entity. Event Hubs requires this string to match precisely (all lowercase, correct namespace + event hub path). If casing or path differs, the service rejects the request with authorization errors.

    Resolution

    As per our internal team, you have confirmed that the issue is now resolved. The fix was to regenerate the SAS token using the correct resource URI (matching the Event Hub namespace and entity name exactly). After applying the updated token, the Event Hub accepted the requests and events flowed successfully.

    Official docs:

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Lenz, Philipp 20 Reputation points MVP
    2025-08-18T14:19:35.52+00:00

    philipp.lenz @ adesso .de

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.