-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathidentity.py
21 lines (17 loc) · 758 Bytes
/
identity.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""Identity helper for Azure SDK clients.
This module provides a default Azure credential that can be used by Azure SDK clients to authenticate with Azure services.
"""
import os
from azure.identity import DefaultAzureCredential
managed_identity_client_id = os.environ.get("MANAGED_IDENTITY_CLIENT_ID", None)
default_credential = DefaultAzureCredential(
exclude_environment_credential=True,
exclude_interactive_browser_credential=True,
exclude_visual_studio_code_credential=True,
exclude_shared_token_cache_credential=True,
exclude_developer_cli_credential=True,
exclude_powershell_credential=True,
exclude_workload_identity_credential=True,
process_timeout=10,
managed_identity_client_id=managed_identity_client_id
)