Skip to content

Commit 1f3b76a

Browse files
Merge pull request #668 from microsoft/dev-v3
fix: Merging dev changes to main branch
2 parents b5af2b3 + b30ad04 commit 1f3b76a

File tree

7 files changed

+42
-24
lines changed

7 files changed

+42
-24
lines changed

docs/quota_check.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ azd auth login
1111

1212
### 📌 Default Models & Capacities:
1313
```
14-
gpt-4o:150
14+
gpt4.1:150,o4-mini:50,gpt4.1-mini:50
1515
```
1616
### 📌 Default Regions:
1717
```
18-
eastus, uksouth, eastus2, northcentralus, swedencentral, westus, westus2, southcentralus, canadacentral
18+
australiaeast, eastus2, francecentral, japaneast, norwayeast, swedencentral, uksouth, westus
1919
```
2020
### Usage Scenarios:
2121
- No parameters passed → Default models and capacities will be checked in default regions.
@@ -37,19 +37,23 @@ eastus, uksouth, eastus2, northcentralus, swedencentral, westus, westus2, southc
3737
```
3838
✔️ Check specific model(s) in default regions:
3939
```
40-
./quota_check_params.sh --models gpt-4o:150
40+
./quota_check_params.sh --models gpt4.1:150
4141
```
4242
✔️ Check default models in specific region(s):
4343
```
44-
./quota_check_params.sh --regions eastus,westus
44+
./quota_check_params.sh --regions eastus2,westus
4545
```
4646
✔️ Passing Both models and regions:
4747
```
48-
./quota_check_params.sh --models gpt-4o:150 --regions eastus,westus2
48+
./quota_check_params.sh --models gpt4.1:150 --regions eastus2,westus
4949
```
5050
✔️ All parameters combined:
5151
```
52-
./quota_check_params.sh --models gpt-4o:150 --regions eastus,westus --verbose
52+
./quota_check_params.sh --models gpt4.1:150 --regions eastus2,westus --verbose
53+
```
54+
✔️ Multiple models with single region:
55+
```
56+
./quota_check_params.sh --models gpt4.1:150,gpt4.1-mini:50 --regions eastus2 --verbose
5357
```
5458

5559
### **Sample Output**

infra/main.bicep

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,6 +1500,9 @@ module webSite 'modules/web-sites.bicep' = {
15001500
WEBSITES_CONTAINER_START_TIME_LIMIT: '1800' // 30 minutes, adjust as needed
15011501
BACKEND_API_URL: 'https://${containerApp.outputs.fqdn}'
15021502
AUTH_ENABLED: 'false'
1503+
AZURE_BASIC_LOGGING_LEVEL: 'INFO'
1504+
AZURE_PACKAGE_LOGGING_LEVEL: 'WARNING'
1505+
AZURE_LOGGING_PACKAGES: ''
15031506
}
15041507
// WAF aligned configuration for Monitoring
15051508
applicationInsightResourceId: enableMonitoring ? applicationInsights!.outputs.resourceId : null

infra/main_custom.bicep

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,6 +1856,9 @@ module webSite 'modules/web-sites.bicep' = {
18561856
//WEBSITES_CONTAINER_START_TIME_LIMIT: '1800' // 30 minutes, adjust as needed
18571857
BACKEND_API_URL: 'https://${containerApp.outputs.fqdn}'
18581858
AUTH_ENABLED: 'false'
1859+
AZURE_BASIC_LOGGING_LEVEL: 'INFO'
1860+
AZURE_PACKAGE_LOGGING_LEVEL: 'WARNING'
1861+
AZURE_LOGGING_PACKAGES: ''
18591862
ENABLE_ORYX_BUILD: 'True'
18601863
}
18611864
// WAF aligned configuration for Monitoring

infra/scripts/quota_check_params.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ log_verbose() {
4747
}
4848

4949
# Default Models and Capacities (Comma-separated in "model:capacity" format)
50-
DEFAULT_MODEL_CAPACITY="gpt-4o:150"
50+
DEFAULT_MODEL_CAPACITY="gpt4.1:150,o4-mini:50,gpt4.1-mini:50"
5151
# Convert the comma-separated string into an array
5252
IFS=',' read -r -a MODEL_CAPACITY_PAIRS <<< "$DEFAULT_MODEL_CAPACITY"
5353

src/backend/.env.sample

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,11 @@ AZURE_AI_SEARCH_INDEX_NAME=
3333
AZURE_AI_SEARCH_ENDPOINT=
3434
AZURE_AI_SEARCH_API_KEY=
3535
BING_CONNECTION_NAME=
36+
37+
# Basic application logging (default: INFO level)
38+
AZURE_BASIC_LOGGING_LEVEL=INFO
39+
# Azure package logging (default: WARNING level to suppress INFO)
40+
AZURE_PACKAGE_LOGGING_LEVEL=WARNING
41+
# Comma-separated list of specific logger names to configure (default: empty - no custom loggers)
42+
# Example: AZURE_LOGGING_PACKAGES=azure.identity.aio._internal,azure.monitor.opentelemetry.exporter.export._base
43+
AZURE_LOGGING_PACKAGES=

src/backend/app_kernel.py

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,18 @@ async def lifespan(app: FastAPI):
6060
"No Application Insights Instrumentation Key found. Skipping configuration"
6161
)
6262

63-
# Configure logging
64-
logging.basicConfig(level=logging.INFO)
65-
66-
# Suppress INFO logs from 'azure.core.pipeline.policies.http_logging_policy'
67-
logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(
68-
logging.WARNING
69-
)
70-
logging.getLogger("azure.identity.aio._internal").setLevel(logging.WARNING)
71-
72-
# # Suppress info logs from OpenTelemetry exporter
73-
logging.getLogger("azure.monitor.opentelemetry.exporter.export._base").setLevel(
74-
logging.WARNING
75-
)
76-
77-
logging.getLogger("opentelemetry.sdk").setLevel(
78-
logging.ERROR
79-
)
63+
# Configure logging levels from environment variables
64+
logging.basicConfig(level=getattr(logging, config.AZURE_BASIC_LOGGING_LEVEL.upper(), logging.INFO))
65+
66+
# Configure Azure package logging levels
67+
azure_level = getattr(logging, config.AZURE_PACKAGE_LOGGING_LEVEL.upper(), logging.WARNING)
68+
# Parse comma-separated logging packages
69+
if config.AZURE_LOGGING_PACKAGES:
70+
packages = [pkg.strip() for pkg in config.AZURE_LOGGING_PACKAGES.split(",") if pkg.strip()]
71+
for logger_name in packages:
72+
logging.getLogger(logger_name).setLevel(azure_level)
73+
74+
logging.getLogger("opentelemetry.sdk").setLevel(logging.ERROR)
8075

8176
# Initialize the FastAPI app
8277
app = FastAPI(lifespan=lifespan)

src/backend/common/config/app_config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ def __init__(self):
7373
# Azure Search settings
7474
self.AZURE_SEARCH_ENDPOINT = self._get_optional("AZURE_AI_SEARCH_ENDPOINT")
7575

76+
# Logging settings
77+
self.AZURE_BASIC_LOGGING_LEVEL = self._get_optional("AZURE_BASIC_LOGGING_LEVEL", "INFO")
78+
self.AZURE_PACKAGE_LOGGING_LEVEL = self._get_optional("AZURE_PACKAGE_LOGGING_LEVEL", "WARNING")
79+
self.AZURE_LOGGING_PACKAGES = self._get_optional("AZURE_LOGGING_PACKAGES")
80+
7681
# Optional MCP server endpoint (for local MCP server or remote)
7782
# Example: http://127.0.0.1:8000/mcp
7883
self.MCP_SERVER_ENDPOINT = self._get_optional("MCP_SERVER_ENDPOINT")

0 commit comments

Comments
 (0)