You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. This change
3
3
4
4
## [Unreleased]
5
5
6
+
### Added (documentation)
7
+
- Azure Managed Identity BYOK guide (`doc/auth/azure-managed-identity.md`): shows how to use `DefaultAzureCredential` with short-lived bearer tokens for Azure AI Foundry, with Clojure examples for basic usage and token refresh (upstream PR #498).
8
+
- Updated BYOK limitations to link to the Managed Identity workaround instead of listing it as fully unsupported.
9
+
- Added Azure Managed Identity guide to `doc/auth/index.md` and `doc/index.md`.
10
+
11
+
### Added (upstream PR #512 sync)
12
+
-`examples/file_attachments.clj` — Demonstrates sending file attachments with prompts using `:attachments` in message options.
13
+
-`examples/session_resume.clj` — Demonstrates session resume: create session, send secret word, resume by ID, verify context preserved.
14
+
-`examples/infinite_sessions.clj` — Demonstrates infinite sessions with context compaction thresholds for long conversations.
15
+
-`examples/lifecycle_hooks.clj` — Demonstrates all 6 lifecycle hooks: session start/end, pre/post tool use, user prompt submitted, error occurred.
16
+
-`examples/reasoning_effort.clj` — Demonstrates the `:reasoning-effort` session config option.
17
+
6
18
## [0.1.28.0] - 2026-02-27
7
19
### Changed (upstream PR #554 sync)
8
20
-**BREAKING**: `:on-permission-request` is now **required** when calling `create-session`, `resume-session`, `<create-session`, and `<resume-session`. Calls without a handler throw `ExceptionInfo` with a descriptive message. This matches upstream Node.js SDK where `onPermissionRequest` is required in `SessionConfig` and `ResumeSessionConfig` (upstream PR #554).
The Copilot SDK's [BYOK mode](./byok.md) accepts static API keys, but Azure deployments often use **Managed Identity** (Entra ID) instead of long-lived keys. Since the SDK does not natively support Entra ID authentication, you can obtain a short-lived bearer token and pass it via the `:bearer-token` provider config field.
4
+
5
+
This guide shows how to use `DefaultAzureCredential` from the [Azure Identity SDK](https://learn.microsoft.com/java/api/overview/azure/identity-readme) to authenticate with Azure AI Foundry models through the Copilot SDK.
6
+
7
+
## How It Works
8
+
9
+
Azure AI Foundry's OpenAI-compatible endpoint accepts bearer tokens from Entra ID in place of static API keys. The pattern is:
10
+
11
+
1. Use `DefaultAzureCredential` to obtain a token for the `https://cognitiveservices.azure.com/.default` scope
12
+
2. Pass the token as `:bearer-token` in the BYOK provider config
13
+
3. Refresh the token before it expires (tokens are typically valid for ~1 hour)
|`AZURE_AI_FOUNDRY_RESOURCE_URL`| Your Azure AI Foundry resource URL |`https://myresource.openai.azure.com`|
104
+
105
+
No API key environment variable is needed — authentication is handled by `DefaultAzureCredential`, which automatically supports:
106
+
107
+
-**Managed Identity** (system-assigned or user-assigned) — for Azure-hosted apps
108
+
-**Azure CLI** (`az login`) — for local development
109
+
-**Environment variables** (`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`) — for service principals
110
+
-**Workload Identity** — for Kubernetes
111
+
112
+
See the [DefaultAzureCredential documentation](https://learn.microsoft.com/java/api/com.azure.identity.defaultazurecredential) for the full credential chain.
113
+
114
+
## When to Use This Pattern
115
+
116
+
| Scenario | Recommendation |
117
+
|----------|----------------|
118
+
| Azure-hosted app with Managed Identity | ✅ Use this pattern |
119
+
| App with existing Azure AD service principal | ✅ Use this pattern |
120
+
| Local development with `az login`| ✅ Use this pattern |
121
+
| Non-Azure environment with static API key | Use [standard BYOK](./byok.md)|
122
+
| GitHub Copilot subscription available | Use [GitHub auth](./index.md#github-signed-in-user)|
123
+
124
+
## See Also
125
+
126
+
-[BYOK Setup Guide](./byok.md) — Static API key configuration
127
+
-[Authentication Overview](./index.md) — All authentication methods
Copy file name to clipboardExpand all lines: doc/auth/byok.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -167,13 +167,14 @@ Some providers require bearer token authentication instead of API keys:
167
167
168
168
### Identity Limitations
169
169
170
-
BYOK authentication is **key-based only**. The following are NOT supported:
170
+
BYOK authentication uses **static credentials that you supply** (API keys or bearer tokens); it does not natively perform Entra ID, OIDC, or managed identity flows. However, you can use `DefaultAzureCredential` to obtain a short-lived bearer token and pass it via `:bearer-token`. See the [Azure Managed Identity workaround](./azure-managed-identity.md) for details.
171
+
172
+
The following identity flows are NOT natively supported (you must handle them yourself and pass the resulting credential to BYOK):
171
173
172
174
- ❌ Microsoft Entra ID (Azure AD) managed identities or service principals
0 commit comments