Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions content-gen/src/backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from services.blob_service import get_blob_service
from services.title_service import get_title_service
from api.admin import admin_bp
from azure.monitor.opentelemetry import configure_azure_monitor

# In-memory task storage for generation tasks
# In production, this should be replaced with Redis or similar
Expand All @@ -37,6 +38,16 @@
logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.WARNING)
logger = logging.getLogger(__name__)

# Check if the Application Insights connection string is set in the environment variables
appinsights_connection_string = os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING")
if appinsights_connection_string:
# Configure Application Insights if the connection string is found
configure_azure_monitor(connection_string=appinsights_connection_string)
logger.info("Application Insights configured with the provided connection string")
else:
# Log a warning if the connection string is not found
logger.warning("No Application Insights connection string found. Skipping configuration")

# Create Quart app
app = Quart(__name__)
app = cors(app, allow_origin="*")
Expand Down
3 changes: 3 additions & 0 deletions content-gen/src/backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ openai>=1.45.0
# HTTP Client (for Foundry direct API calls)
httpx>=0.27.0

# Monitoring / Telemetry
azure-monitor-opentelemetry>=1.6.0

# Data Validation
pydantic>=2.8.0
pydantic-settings>=2.4.0
Expand Down