Skip to content

Commit 9e19c55

Browse files
Merge pull request #549 from microsoft/psl-pk-managedidentity
fix: Use ManagedIdentityCredential with Configurable Client ID
2 parents f8ddbf2 + a19f7a7 commit 9e19c55

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/api/common/database/sqldb_service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ async def get_db_connection():
1818
username = config.sqldb_username
1919
password = config.sqldb_database
2020
driver = config.driver
21+
mid_id = config.mid_id
2122

2223
try:
23-
async with ManagedIdentityCredential() as credential:
24+
async with ManagedIdentityCredential(client_id=mid_id) as credential:
2425
token = await credential.get_token("https://database.windows.net/.default")
2526
token_bytes = token.token.encode("utf-16-LE")
2627
token_struct = struct.pack(

0 commit comments

Comments
 (0)