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
106 changes: 106 additions & 0 deletions python/copilot-studio/sample-agent/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# =============================================================================
# Copilot Studio Sample Agent — Environment Configuration
# =============================================================================
# Copy this file to .env and fill in your values:
# cp .env.template .env
#
# All values marked <<...>> MUST be replaced before the agent will work.
# Run `a365 setup all --agent-name "<name>" --aiteammate` first — it generates
# the config files referenced below.
# =============================================================================

# -----------------------------------------------------------------------------
# Copilot Studio Configuration
# -----------------------------------------------------------------------------
# Choose ONE of the following approaches:

# Option 1: Direct Connect URL (recommended for quick setup)
# Get this from Copilot Studio > Settings > Advanced > Metadata
DIRECT_CONNECT_URL=

# Option 2: Environment ID + Agent Identifier
# Get these from Copilot Studio > Settings > Advanced > Metadata
ENVIRONMENT_ID=<<your-environment-id>>
AGENT_IDENTIFIER=<<your-agent-schema-name>>

# -----------------------------------------------------------------------------
# Agent365 Service Connection (OAuth client credentials)
# -----------------------------------------------------------------------------
# These values authenticate your agent with the Bot Framework and Agent 365.
#
# Where to find them (after running `a365 setup all`):
# CLIENTID => a365.generated.config.json → agentBlueprintId
# CLIENTSECRET => a365.generated.config.json → agentBlueprintClientSecret
# TENANTID => a365.config.json → tenantId
#
# IMPORTANT — Client Secret:
# a365.generated.config.json stores the secret encrypted (Windows DPAPI).
# Use `a365 config display -g` to view the decrypted secret.
CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTID=<<blueprint-app-id>>
CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTSECRET=<<blueprint-client-secret>>
CONNECTIONS__SERVICE_CONNECTION__SETTINGS__TENANTID=<<tenant-id>>
CONNECTIONS__SERVICE_CONNECTION__SETTINGS__SCOPES=5a807f24-c9de-44ee-a3a7-329e88a00ffc/.default

# Connection mapping (do not change)
CONNECTIONSMAP__0__CONNECTION=SERVICE_CONNECTION
CONNECTIONSMAP__0__SERVICEURL=*

# -----------------------------------------------------------------------------
# Agent Identity
# -----------------------------------------------------------------------------
# At runtime, tenant_id and agent_id are extracted from the incoming
# TurnContext activity (context.activity.recipient). Env vars are fallbacks
# for local dev / Agents Playground where the activity may lack these fields.
AGENTIC_TENANT_ID=<<tenant-id>>
AGENTIC_UPN=<<agent-upn>>
AGENTIC_NAME=<<agent-display-name>>

# -----------------------------------------------------------------------------
# Server
# -----------------------------------------------------------------------------
# Port for the aiohttp server.
# Local dev default: 3978. Azure App Service injects PORT automatically.
PORT=3978

# -----------------------------------------------------------------------------
# Authentication
# -----------------------------------------------------------------------------
# AUTH_HANDLER_NAME controls authentication mode:
# "" — anonymous (Agents Playground / local dev)
# "AGENTIC" — production (Teams / Azure deployment)
#
# IMPORTANT: Must be uppercase "AGENTIC" to match the handler key in
# AGENTAPPLICATION__USERAUTHORIZATION__HANDLERS__AGENTIC__...
AUTH_HANDLER_NAME=

# Server JWT authentication (required when AUTH_HANDLER_NAME=AGENTIC)
CLIENT_ID=<<blueprint-app-id>>
TENANT_ID=<<tenant-id>>
CLIENT_SECRET=<<blueprint-client-secret>>

# Agentic user-authorization handler settings (do not change these defaults)
AGENT_ID=<<blueprint-app-id>>
AGENTAPPLICATION__USERAUTHORIZATION__HANDLERS__AGENTIC__SETTINGS__TYPE=AgenticUserAuthorization
AGENTAPPLICATION__USERAUTHORIZATION__HANDLERS__AGENTIC__SETTINGS__ALT_BLUEPRINT_NAME=SERVICE_CONNECTION
AGENTAPPLICATION__USERAUTHORIZATION__HANDLERS__AGENTIC__SETTINGS__SCOPES=https://graph.microsoft.com/.default

# (Optional) Bearer token for local dev without agentic auth.
# Obtain with: a365 develop get-token -o raw
# BEARER_TOKEN=

# -----------------------------------------------------------------------------
# Observability
# -----------------------------------------------------------------------------
ENABLE_OBSERVABILITY=true
ENABLE_A365_OBSERVABILITY_EXPORTER=false
ENABLE_KAIRO_EXPORTER=false
A365_OBSERVABILITY_LOG_LEVEL=info

# Observability identity (values from a365 setup all)
AGENT365OBSERVABILITY__AGENTID=<<blueprint-app-id>>
AGENT365OBSERVABILITY__AGENTNAME=<<agent-display-name>>
AGENT365OBSERVABILITY__AGENTDESCRIPTION=<<agent-description>>
AGENT365OBSERVABILITY__TENANTID=<<tenant-id>>
AGENT365OBSERVABILITY__AGENTBLUEPRINTID=<<blueprint-app-id>>
AGENT365OBSERVABILITY__CLIENTID=<<blueprint-app-id>>
AGENT365OBSERVABILITY__CLIENTSECRET=<<blueprint-client-secret>>
43 changes: 43 additions & 0 deletions python/copilot-studio/sample-agent/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Environment
.env
.venv/
venv/
env/

# Python
__pycache__/
*.py[cod]
*$py.class
*.so
*.egg-info/
dist/
build/
*.egg

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# OS
.DS_Store
Thumbs.db

# Agent 365 generated / local state
a365.config.json
a365.generated.config.json
chat.json
deploy.zip
devTools/
manifest/

# Logs
*.log

# Testing
.pytest_cache/
htmlcov/
.coverage
coverage.xml
Loading
Loading