Skip to content

Commit 70fe75b

Browse files
use managed identity
1 parent ba80922 commit 70fe75b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/api/common/database/sqldb_service.py

Lines changed: 3 additions & 2 deletions
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-
21+
mid_id = config.mid_id
22+
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)