#StackBounty: #python-3.x #azure #azureservicebus #azure-servicebus-topics In the Azure functions Python SDK, how do I get the number o…

Bounty: 150

I’m using Python 3.8 with azure-mgmt-servicebus= v. 1.0.0. I would like to get the number of topics for a given namespace. I have tried the below …

credential = ServicePrincipalCredentials(self._client_id, self._client_secret, tenant=self._tenant)
        sb_client = ServiceBusManagementClient(credential, self._subscription)
        topics = sb_client.topics.list_by_namespace(
            num_topics = 0
            while topics.current_page:
                num_topics += topics.current_page.count
            logging.info("num topics: %s", num_topics)

My "num_topics" consistently comes back with zero, despite the fact I have verified that my connection is being made (I can create a topic with the same connection) and I can see many topics for the given information in the Azure portal. I’m thinking I’m not using the API properly but am unsure where things are falling apart. How do I get the number of topics for a given namespace?

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.