We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e0795f commit 6b23711Copy full SHA for 6b23711
code/function/fastapp/utils.py
@@ -1,7 +1,7 @@
1
import logging
2
from logging import Logger
3
4
-from azure.identity import DefaultAzureCredential
+from azure.identity import ManagedIdentityCredential
5
from azure.monitor.opentelemetry.exporter import AzureMonitorTraceExporter
6
from fastapi import FastAPI
7
from fastapp.core.config import settings
@@ -36,7 +36,7 @@ def setup_tracer(app: FastAPI):
36
RETURNS (None): Nothing is being returned.
37
"""
38
if settings.APPLICATIONINSIGHTS_CONNECTION_STRING:
39
- credential = DefaultAzureCredential()
+ credential = ManagedIdentityCredential()
40
exporter = AzureMonitorTraceExporter.from_connection_string(
41
settings.APPLICATIONINSIGHTS_CONNECTION_STRING, credential=credential
42
)
0 commit comments