-
Notifications
You must be signed in to change notification settings - Fork 60
Users/axsuarez/agent framework sample #336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
30593dd
79b325c
1f4304c
856a4e0
2a7b2b5
b322ca1
3604eb3
706b289
f425f7f
6f620cf
01bd9f8
2f941a0
2458cf9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # M365 Agents SDK configuration | ||
| CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTID=client-id-here | ||
| CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTSECRET=client-secret-here | ||
| CONNECTIONS__SERVICE_CONNECTION__SETTINGS__TENANTID=tenant-id-here | ||
|
|
||
| # Azure OpenAI Configuration | ||
| AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/ | ||
| AZURE_OPENAI_API_KEY=your-api-key-here | ||
| AZURE_OPENAI_DEPLOYMENT=gpt-4o-mini | ||
| AZURE_OPENAI_API_VERSION=2024-12-01-preview | ||
|
|
||
| # OpenWeatherMap API Key | ||
| # Get your free API key from: https://openweathermap.org/price | ||
| OPENWEATHER_API_KEY=your-openweather-api-key | ||
|
|
||
|
|
||
| # Observability | ||
| OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 | ||
| ENABLE_OTLP_EXPORTER=True | ||
| OTEL_EXPORTER_OTLP_INSECURE=true | ||
|
|
||
| OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST=".*" | ||
| OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE=".*" | ||
|
|
||
| OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_CLIENT_REQUEST=".*" | ||
| OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_CLIENT_RESPONSE=".*" | ||
|
Comment on lines
+22
to
+26
|
||
| # APPLICATIONINSIGHTS_CONNECTION_STRING=InstrumentationKey=your-key-here | ||
|
|
||
| # Required for observability SDK | ||
| ENABLE_OBSERVABILITY=true | ||
| #ENABLE_A365_OBSERVABILITY_EXPORTER=false | ||
| PYTHON_ENVIRONMENT=development | ||
| ENABLE_OPENTELEMETRY_SWITCH=true | ||
|
|
||
| # Observability Configuration | ||
| OBSERVABILITY_SERVICE_NAME=agent-framework-sample | ||
| OBSERVABILITY_SERVICE_NAMESPACE=agents-framework.samples | ||
|
|
||
| # Enable otel logs on AgentFramework SDK. Required for auto instrumentation | ||
| ENABLE_OTEL=true | ||
| ENABLE_SENSITIVE_DATA=true | ||
|
Comment on lines
+39
to
+41
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,145 @@ | ||||||
| # Weather Agent Sample | ||||||
|
|
||||||
| A sample agent built with the Microsoft 365 Agents SDK for Python. It uses Azure OpenAI for natural language understanding, OpenWeatherMap for weather lookups, and exports telemetry to an Aspire dashboard via OpenTelemetry. | ||||||
|
|
||||||
| ## Prerequisites | ||||||
|
|
||||||
| - **Python 3.11+** (3.10+ supported) | ||||||
|
||||||
| - **Python 3.11+** (3.10+ supported) | |
| - **Python 3.10+** (3.11+ recommended) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from .weather_agent import WeatherAgent | ||
|
|
||
| __all__ = ["WeatherAgent"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_*=".*"will cause OpenTelemetry to capture and export all HTTP request and response headers (includingAuthorization, cookies, and API keys) into telemetry. This can leak access tokens and other secrets into backends like the Aspire dashboard or Application Insights, especially when combined with options that enable sensitive data logging. Restrict header capture to a small, non-sensitive allowlist or rely on the default configuration that excludes sensitive headers instead of using a catch‑all pattern.