Skip to content

Commit 6b23711

Browse files
committed
Used managed identity credential
1 parent 1e0795f commit 6b23711

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

code/function/fastapp/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22
from logging import Logger
33

4-
from azure.identity import DefaultAzureCredential
4+
from azure.identity import ManagedIdentityCredential
55
from azure.monitor.opentelemetry.exporter import AzureMonitorTraceExporter
66
from fastapi import FastAPI
77
from fastapp.core.config import settings
@@ -36,7 +36,7 @@ def setup_tracer(app: FastAPI):
3636
RETURNS (None): Nothing is being returned.
3737
"""
3838
if settings.APPLICATIONINSIGHTS_CONNECTION_STRING:
39-
credential = DefaultAzureCredential()
39+
credential = ManagedIdentityCredential()
4040
exporter = AzureMonitorTraceExporter.from_connection_string(
4141
settings.APPLICATIONINSIGHTS_CONNECTION_STRING, credential=credential
4242
)

0 commit comments

Comments
 (0)