I'm using the latest Python Azure SDK
azure-mgmt-servicebus==6.0.0
azure-servicebus==7.0.0
I get a reference to a ServiceBusManagementClient like so ...
def _get_sb_client(self):
credential = ClientSecretCredential(
tenant_id=self._tenant,
client_id=self._client_id,
client_secret=self._client_secret
)
return ServiceBusManagementClient(
credential, self._subscription)
However, according to this -- https://learn.microsoft.com/en-us/python/api/overview/azure/servicebus?view=azure-python#service-bus-topics-and-subscriptions, in order to send a message on a topic,
topic_client = sb_client.get_topic("MyTopic")
I need a reference to a azure.servicebus.ServiceBusClient object. However, the docs don't give any explanations about how to generate such an instance, other than through a connection string, which we are not using. How can I get an instance of ServiceBusClient using ClientSecretCredential or ServiceBusManagementClient instances?
I'd respond with few things, do let me know if any of this needs clarification or is off-base:
Example of sending and receiving to a topic/subscription
Example of authenticating with Azure Identity