azure-sdk-for-python: Unable to consume events using interactive browser credential

  • Package Name: azure-eventhub
  • Package Version: 5.11.1
  • Operating System: MacOS
  • Python Version: Python 3.9

Describe the bug

With an InteractiveBrowserCredential credential I get the following error consuming via azure.eventhub.aio.EventHubConsumerClient:

azure.eventhub._pyamqp.aio._session_async:Unable to attach new link: ValueError('Invalid link')

This problem goes away if I use EventHubSharedKeyCredential.

I am “Owner” on the event hub resource.

To Reproduce Steps to reproduce the behavior:

  1. Create event hub.
  2. Connect via InteractiveBrowserCredential.

Expected behavior No error.

Screenshots N/A

Additional context Digging deeper into the exception origin, I see the following error message:

Cannot get source or target. Detaching link

This happens in _link_async.py.

Note that within the same program run, the “happy path” of that code block is also visited frequently.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

Adding that role did the trick. I thought being Owner was enough to implicitly be allowed data access.

For future readers of this issue, wrapping the InteractiveBrowserCredential in a simple async wrapping class does work.

@malthe can you add this one specifically please Azure Event Hubs Data Owner ?

Yes I am Owner on the resource. On the RG as well.

man. 30. jan. 2023 kl. 19.52 skrev Kashif Khan @.***>:

@malthe https://github.com/malthe your IAM on the EH is Azure Event Hubs Data Owner ?

— Reply to this email directly, view it on GitHub https://github.com/Azure/azure-sdk-for-python/issues/28498#issuecomment-1409157879, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAGOJKGOLAETD4IQ4GNOSTWVAEV3ANCNFSM6AAAAAAUH7VIJI . You are receiving this because you were mentioned.Message ID: @.***>