File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9898 rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }})
9999 if [ "$rg_exists" = "false" ]; then
100100 echo "Resource group does not exist. Creating..."
101- az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location northcentralus || { echo "Error creating resource group"; exit 1; }
101+ az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location australiaeast || { echo "Error creating resource group"; exit 1; }
102102 else
103103 echo "Resource group already exists."
104104 fi
@@ -382,7 +382,7 @@ jobs:
382382
383383 # Purge OpenAI Resource
384384 echo "Purging the OpenAI Resource..."
385- if ! az resource delete --ids /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/providers/Microsoft.CognitiveServices/locations/northcentralus /resourceGroups/${{ env.RESOURCE_GROUP_NAME }}/deletedAccounts/${{ env.OPENAI_RESOURCE_NAME }} --verbose; then
385+ if ! az resource delete --ids /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/providers/Microsoft.CognitiveServices/locations/australiaeast /resourceGroups/${{ env.RESOURCE_GROUP_NAME }}/deletedAccounts/${{ env.OPENAI_RESOURCE_NAME }} --verbose; then
386386 echo "Failed to purge openai resource: ${{ env.OPENAI_RESOURCE_NAME }}"
387387 else
388388 echo "Purged the openai resource: ${{ env.OPENAI_RESOURCE_NAME }}"
Original file line number Diff line number Diff line change @@ -887,10 +887,7 @@ module containerAppBackend 'br/public:avm/res/app/container-app:0.19.0' = {
887887 name : 'AZURE_BLOB_CONTAINER_NAME'
888888 value : appStorageContainerName
889889 }
890- {
891- name : 'AZURE_OPENAI_ENDPOINT'
892- value : 'https://${aiServices .outputs .name }.openai.azure.com/'
893- }
890+
894891 {
895892 name : 'MIGRATOR_AGENT_MODEL_DEPLOY'
896893 value : modelDeployment .name
@@ -955,6 +952,18 @@ module containerAppBackend 'br/public:avm/res/app/container-app:0.19.0' = {
955952 name : 'APP_ENV'
956953 value : 'prod'
957954 }
955+ {
956+ name : 'AZURE_BASIC_LOGGING_LEVEL'
957+ value : 'INFO'
958+ }
959+ {
960+ name : 'AZURE_PACKAGE_LOGGING_LEVEL'
961+ value : 'WARNING'
962+ }
963+ {
964+ name : 'AZURE_LOGGING_PACKAGES'
965+ value : ''
966+ }
958967 ],
959968 enableMonitoring
960969 ? [
@@ -1072,7 +1081,6 @@ output WEB_APP_URL string = 'https://${containerAppFrontend.outputs.fqdn}'
10721081output COSMOSDB_ENDPOINT string = cosmosDb .outputs .endpoint
10731082output AZURE_BLOB_ACCOUNT_NAME string = storageAccount .outputs .name
10741083output AZURE_BLOB_ENDPOINT string = 'https://${storageAccount .outputs .name }.blob.core.windows.net/'
1075- output AZURE_OPENAI_ENDPOINT string = 'https://${aiServices .outputs .name }.openai.azure.com/'
10761084output AZURE_AI_AGENT_PROJECT_NAME string = aiServices .outputs .aiProjectInfo .name
10771085output AZURE_AI_AGENT_ENDPOINT string = aiServices .outputs .aiProjectInfo .apiEndpoint
10781086output AZURE_AI_AGENT_PROJECT_CONNECTION_STRING string = aiServices .outputs .aiProjectInfo .apiEndpoint
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -921,10 +921,7 @@ module containerAppBackend 'br/public:avm/res/app/container-app:0.19.0' = {
921921 name : 'AZURE_BLOB_CONTAINER_NAME'
922922 value : appStorageContainerName
923923 }
924- {
925- name : 'AZURE_OPENAI_ENDPOINT'
926- value : 'https://${aiServices .outputs .name }.openai.azure.com/'
927- }
924+
928925 {
929926 name : 'MIGRATOR_AGENT_MODEL_DEPLOY'
930927 value : modelDeployment .name
@@ -985,6 +982,18 @@ module containerAppBackend 'br/public:avm/res/app/container-app:0.19.0' = {
985982 name : 'APP_ENV'
986983 value : 'prod'
987984 }
985+ {
986+ name : 'AZURE_BASIC_LOGGING_LEVEL'
987+ value : 'INFO'
988+ }
989+ {
990+ name : 'AZURE_PACKAGE_LOGGING_LEVEL'
991+ value : 'WARNING'
992+ }
993+ {
994+ name : 'AZURE_LOGGING_PACKAGES'
995+ value : ''
996+ }
988997 ],
989998 enableMonitoring
990999 ? [
@@ -1113,7 +1122,6 @@ output COSMOSDB_ENDPOINT string = cosmosDb.outputs.endpoint
11131122output AZURE_BLOB_ACCOUNT_NAME string = storageAccount .outputs .name
11141123output AZURE_BLOB_ENDPOINT string = 'https://${storageAccount .outputs .name }.blob.core.windows.net/'
11151124output AZURE_CONTAINER_REGISTRY_ENDPOINT string = containerRegistry .properties .loginServer
1116- output AZURE_OPENAI_ENDPOINT string = 'https://${aiServices .outputs .name }.openai.azure.com/'
11171125output AZURE_AI_AGENT_PROJECT_NAME string = aiServices .outputs .aiProjectInfo .name
11181126output AZURE_AI_AGENT_ENDPOINT string = aiServices .outputs .aiProjectInfo .apiEndpoint
11191127output AZURE_AI_AGENT_RESOURCE_GROUP_NAME string = resourceGroup ().name
Original file line number Diff line number Diff line change @@ -25,4 +25,12 @@ AZURE_AI_AGENT_RESOURCE_GROUP_NAME = ""
2525AZURE_AI_AGENT_PROJECT_NAME = " "
2626AZURE_AI_AGENT_MODEL_DEPLOYMENT_NAME = " "
2727
28- APP_ENV = " dev"
28+ APP_ENV = " dev"
29+
30+ # Basic application logging (default: INFO level)
31+ AZURE_BASIC_LOGGING_LEVEL = INFO
32+ # Azure package logging (default: WARNING level to suppress INFO)
33+ AZURE_PACKAGE_LOGGING_LEVEL = WARNING
34+ # Comma-separated list of specific logger names to configure (default: empty - no custom loggers)
35+ # Example: AZURE_LOGGING_PACKAGES=azure.identity.aio._internal,azure.monitor.opentelemetry.exporter.export._base
36+ AZURE_LOGGING_PACKAGES =
Original file line number Diff line number Diff line change 5353 "No Application Insights Instrumentation Key found. Skipping configuration"
5454 )
5555
56- # Configure logging
57- logging .basicConfig (level = logging .INFO )
58-
59- # Suppress INFO logs from 'azure.core.pipeline.policies.http_logging_policy'
60- logging .getLogger ("azure.core.pipeline.policies.http_logging_policy" ).setLevel (
61- logging .WARNING
62- )
63- logging .getLogger ("azure.identity.aio._internal" ).setLevel (logging .WARNING )
64-
65- # Suppress info logs from OpenTelemetry exporter
66- logging .getLogger ("azure.monitor.opentelemetry.exporter.export._base" ).setLevel (
67- logging .WARNING
68- )
69-
7056
7157def record_exception_to_trace (e ):
7258 """Record exception to the current OpenTelemetry trace span."""
Original file line number Diff line number Diff line change 11"""Create and configure the FastAPI application."""
2+ import logging
3+ import os
24from contextlib import asynccontextmanager
35
46from api .api_routes import router as backend_router
2628load_dotenv ()
2729
2830# Configure logging
31+ # Basic application logging (default: INFO level)
32+ AZURE_BASIC_LOGGING_LEVEL = os .getenv ("AZURE_BASIC_LOGGING_LEVEL" , "INFO" ).upper ()
33+ # Azure package logging (default: WARNING level to suppress INFO)
34+ AZURE_PACKAGE_LOGGING_LEVEL = os .getenv ("AZURE_PACKAGE_LOGGING_LEVEL" , "WARNING" ).upper ()
35+ # Azure logging packages (default: empty list)
36+ azure_logging_packages_env = os .getenv ("AZURE_LOGGING_PACKAGES" )
37+ AZURE_LOGGING_PACKAGES = azure_logging_packages_env .split ("," ) if azure_logging_packages_env else []
38+
39+ # Basic config: logging.basicConfig(level=logging.INFO)
40+ logging .basicConfig (
41+ level = getattr (logging , AZURE_BASIC_LOGGING_LEVEL , logging .INFO ),
42+ format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
43+ )
44+
45+ # Package config: Azure loggers set to WARNING to suppress INFO
46+ for logger_name in AZURE_LOGGING_PACKAGES :
47+ logging .getLogger (logger_name ).setLevel (getattr (logging , AZURE_PACKAGE_LOGGING_LEVEL , logging .WARNING ))
48+
2949logger = AppLogger ("app" )
3050
3151# Global variables for agents
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ def __init__(self):
3939 self .azure_service_bus_namespace = os .getenv ("AZURE_SERVICE_BUS_NAMESPACE" )
4040 self .azure_queue_name = os .getenv ("AZURE_QUEUE_NAME" )
4141
42- self .azure_openai_endpoint = os .getenv ("AZURE_OPENAI_ENDPOINT" )
4342 self .ai_project_endpoint = os .getenv ("AI_PROJECT_ENDPOINT" )
4443 self .migrator_agent_model_deploy = os .getenv ("MIGRATOR_AGENT_MODEL_DEPLOY" )
4544 self .picker_agent_model_deploy = os .getenv ("PICKER_AGENT_MODEL_DEPLOY" )
Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ typing-extensions
3636python-jose [cryptography ]
3737passlib [bcrypt ]
3838semantic-kernel [azure ]== 1.32.2
39- openai == 2.0.0
4039sqlparse
4140sqlglot
4241unittest2
You can’t perform that action at this time.
0 commit comments