tessl install tessl/pypi-azure-servicebus@7.14.0Microsoft Azure Service Bus Client Library for Python providing comprehensive messaging capabilities for enterprise applications.
Agent Success
Agent success rate when using this tile
92%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.01x
Baseline
Agent success rate without this tile
91%
Build a service to manage Azure Service Bus client connections using multiple authentication methods.
Create a module that provides authenticated Service Bus client instances. The module should support creating clients using different credential types and return properly initialized ServiceBusClient instances ready for messaging operations.
Your module must support creating Service Bus clients using three authentication methods:
Implement functions that:
Your implementation should handle these scenarios:
@generates
from azure.servicebus import ServiceBusClient
from azure.core.credentials import TokenCredential, AzureSasCredential, AzureNamedKeyCredential
def create_client_with_sas(
fully_qualified_namespace: str,
shared_access_key_name: str,
shared_access_key: str
) -> ServiceBusClient:
"""
Create a ServiceBusClient using SAS (Shared Access Signature) authentication.
Args:
fully_qualified_namespace: The Service Bus namespace (e.g., 'mybus.servicebus.windows.net')
shared_access_key_name: The name of the shared access key
shared_access_key: The shared access key value
Returns:
A ServiceBusClient instance authenticated with SAS credentials
"""
pass
def create_client_with_aad(
fully_qualified_namespace: str,
credential: TokenCredential
) -> ServiceBusClient:
"""
Create a ServiceBusClient using Azure Active Directory authentication.
Args:
fully_qualified_namespace: The Service Bus namespace (e.g., 'mybus.servicebus.windows.net')
credential: A TokenCredential instance (e.g., DefaultAzureCredential)
Returns:
A ServiceBusClient instance authenticated with Azure AD credentials
"""
pass
def create_client_with_named_key(
fully_qualified_namespace: str,
policy_name: str,
key: str
) -> ServiceBusClient:
"""
Create a ServiceBusClient using named key authentication.
Args:
fully_qualified_namespace: The Service Bus namespace (e.g., 'mybus.servicebus.windows.net')
policy_name: The name of the shared access policy
key: The key associated with the policy
Returns:
A ServiceBusClient instance authenticated with named key credentials
"""
passProvides Azure Service Bus messaging client capabilities including authentication and connection management.
@satisfied-by
Provides core credential types for Azure authentication.
@satisfied-by