class_docstr: Interact with ServiceBusClient.
  
  This acts as a high level interface for getting ServiceBusSender and ServiceBusReceiver.
class_docstr_tok: ["Interact","with","ServiceBusClient",".","This","acts","as","a","high","level","interface","for","getting","ServiceBusSender","and","ServiceBusReceiver","."]
docstr: Create and returns ServiceBusClient by using the connection string in connection details.
docstr_tok: ["Create","and","returns","ServiceBusClient","by","using","the","connection","string","in","connection","details","."]
code: def get_conn(self) -> ServiceBusClient:
      """Create and returns ServiceBusClient by using the connection string in connection details."""
      conn = self.get_connection(self.conn_id)
      connection_string: str = str(conn.schema)
      if connection_string:
          client = ServiceBusClient.from_connection_string(
              connection_string, logging_enable=True
          )
      else:
          extras = conn.extra_dejson
          credential: str | DefaultAzureCredential = self._get_field(
              extras=extras, field_name="credential"
          )
          fully_qualified_namespace = self._get_field(
              extras=extras, field_name="fully_qualified_namespace"
          )
          if not credential:
              managed_identity_client_id = self._get_field(
                  extras=extras, field_name="managed_identity_client_id"
              )
              workload_identity_tenant_id = self._get_field(
                  extras=extras,
                  field_name="workload_identity_tenant_id",
              )
              credential = get_sync_default_azure_credential(
                  managed_identity_client_id=managed_identity_client_id,
                  workload_identity_tenant_id=workload_identity_tenant_id,
              )
          client = ServiceBusClient(
              fully_qualified_namespace=fully_qualified_namespace,
              credential=credential,  # type: ignore[arg-type]
          )
  
      self.log.info("Create and returns ServiceBusClient")
      return client
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Any
  from azure.servicebus import ServiceBusClient, ServiceBusMessage, ServiceBusSender
  from azure.servicebus.management import QueueProperties, ServiceBusAdministrationClient
  from airflow.hooks.base import BaseHook
  from airflow.providers.microsoft.azure.utils import add_managed_identity_connection_widgets, get_field, get_sync_default_azure_credential
label_desc: Use image node_id 1 for calling the MessageHook obj's underlying member method code with example usage: obj.get_conn() and returns: client