code: def authenticate(creds: AnyAzureCreds) -> Tuple[AzureCredential, str]:
      credential, tenant_id = get_credential(creds)
      check_credential(credential)
      return credential, tenant_id
  
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 1 for calling a global function with example usage: authenticate(creds) and returns: credential,  tenant_id