Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Event Hubs] Update URI used for consumer auth to include consumer group #35626

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

swathipil
Copy link
Member

fixes #35337

Currently, the URI used for authentication on the receiver only includes the EH namespace and hub. We should include the consumer group.

When consumer group is not included, we get an error when we try receiving with the Event Hubs Data Receiver role assigned to either the User/Service Principal at the consumer group level. To test assigning the role at the consumer group level, follow [these instructions]. (If testing on the Portal, consumergroups/<groupname> should be added to the end of the url after the hub name.)

Tested locally for this scenario, which passes. Not adding a test, as it would require us to add the role using the azure-mgmt-authorization package, which we would have to add to the dev_requirements.txt.

@swathipil swathipil marked this pull request as ready for review May 14, 2024 22:34
@swathipil
Copy link
Member Author

/azp run python - eventhub - tests

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@kashifkhan
Copy link
Member

/azp run python - eventhub - tests

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -191,6 +191,7 @@ def __init__(
network_tracing=network_tracing,
**kwargs,
)
self._auth_uri = f"sb://{self._address.hostname}{self._address.path}/consumergroups/{self._consumer_group}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 thoughts - could we be resetting the path when we use $default, or do we not need to do this when not using RBAC?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oo good thoughts - will check!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eventhub Entra ID authentication fails with RBAC permissions granted on consumer group
4 participants