Skip to content

Async ServiceBusClient does not respect the connection_verify parameter #26015

@colinbreame

Description

@colinbreame

The async ServiceBusClient is not using the connection_verify parameter.

This version works as expected:

from azure.servicebus import ServiceBusClient
import logging

logging.basicConfig(level=logging.INFO)

certificates = "cacert.pem"

def run():
    with ServiceBusClient.from_connection_string(conn_str, connection_verify=certificates) as client:
        receiver = client.get_subscription_receiver(topic_name, subscription_name)

        while True:
            for msg in receiver.receive_messages():
                print(msg)
run()

but the async version does not:

from azure.servicebus.aio import ServiceBusClient
import logging
import asyncio

logging.basicConfig(level=logging.INFO)

certificates = "cacert.pem"

async def run():
    async with ServiceBusClient.from_connection_string(conn_str, connection_verify=certificates) as client:
        receiver = client.get_subscription_receiver(topic_name, subscription_name)

        while True:
            for msg in await receiver.receive_messages():
                print(msg)

asyncio.run(run())

With the async version, you can use any value for connection_verify and it does not complain if the file does not exist (unlike the sync version).

azure-servicebus version installed from pip:

$ pip show 
Name: azure-servicebus
Version: 7.8.0
Summary: Microsoft Azure Service Bus Client Library for Python
Home-page: https://github.com/Azure/azure-sdk-for-python
Author: Microsoft Corporation
Author-email: azpysdkhelp@microsoft.com
License: MIT License
Location: c:\users\u52587\miniconda3\envs\_scripting38w_2021_1\lib\site-packages
Requires: azure-common, azure-core, isodate, msrest, six, typing-extensions, uamqp
Required-by:

Metadata

Metadata

Labels

ClientThis issue points to a problem in the data-plane of the library.Service Buscustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions