code: def check_credential(credential: AzureCredential):
      client = SubscriptionClient(credential=credential)
      try:
          list(client.subscriptions.list())
      except ClientAuthenticationError:
          raise BackendAuthError()
  
file_path: dstack/src/dstack/_internal/core/backends/azure/auth.py
imports: from typing import Tuple, Union
  from azure.core.exceptions import ClientAuthenticationError
  from azure.identity import ClientSecretCredential, DefaultAzureCredential
  from azure.mgmt.subscription import SubscriptionClient
  from dstack._internal.core.errors import BackendAuthError
  from dstack._internal.core.models.backends.azure import AnyAzureCreds, AzureClientCreds, AzureDefaultCreds
label_desc: Use image node_id 3 for calling a global function with example usage: check_credential(credential) without return types