Skip to content

Commit ceb1fbf

Browse files
committed
tweak_az_identity
1 parent bec8c79 commit ceb1fbf

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "dean_utils"
7-
version="0.0.56"
7+
version="0.0.57"
88
authors=[
99
{ name="Dean MacGregor", email="powertrading121@gmail.com"}
1010
]

src/dean_utils/utils/az_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@
3232
try:
3333
from azure.identity.aio import DefaultAzureCredential
3434

35-
credential = DefaultAzureCredential()
35+
kwargs = {}
36+
if (client_id := os.environ.get("AzureWebJobsStorage__clientId")) is not None:
37+
kwargs["managed_identity_client_id"] = client_id
38+
credential = DefaultAzureCredential(**kwargs)
3639
AIO_SERVE = QSC(account_url=account_url, credential=credential)
3740
except ImportError as err:
3841
GLOBAL_ERR = err

0 commit comments

Comments
 (0)