Skip to content

Commit 183b987

Browse files
docs: document Azure OpenAI OIDC authentication support
Update docs/api-proxy-sidecar.md to document the new GitHub Actions OIDC → Azure AD workload identity federation support added in commit e26e9de. - Remove the outdated limitation stating Azure OpenAI is unsupported - Add a new 'Azure OpenAI (Entra-only / OIDC authentication)' section with: - Explanation of the OIDC token flow - Required and optional environment variables (AWF_AUTH_TYPE, AWF_AUTH_AZURE_*) - GitHub Actions workflow example with correct permissions and env vars Co-authored-by: Copilot <[email protected]>
1 parent e26e9de commit 183b987

1 file changed

Lines changed: 62 additions & 1 deletion

File tree

docs/api-proxy-sidecar.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,71 @@ Check Squid logs for denied requests:
494494
docker exec awf-squid cat /var/log/squid/access.log | grep DENIED
495495
```
496496

497+
## Azure OpenAI (Entra-only / OIDC authentication)
498+
499+
AWF supports Azure OpenAI deployments that have API keys disabled and use **Entra-only (Azure AD) authentication** via GitHub Actions OIDC workload identity federation.
500+
501+
### How it works
502+
503+
When `AWF_AUTH_TYPE=github-oidc` is set, the api-proxy sidecar:
504+
1. Requests a GitHub Actions OIDC JWT token from the Actions runtime
505+
2. Exchanges it for an Azure AD access token via workload identity federation
506+
3. Injects the resulting Bearer token on every OpenAI request
507+
508+
The token is cached and proactively refreshed before expiry — no manual rotation required.
509+
510+
### Required environment variables
511+
512+
| Variable | Description |
513+
|----------|-------------|
514+
| `AWF_AUTH_TYPE` | Set to `github-oidc` to enable OIDC authentication |
515+
| `AWF_AUTH_AZURE_TENANT_ID` | Azure AD tenant ID |
516+
| `AWF_AUTH_AZURE_CLIENT_ID` | Azure AD application (client) ID for the federated credential |
517+
| `ACTIONS_ID_TOKEN_REQUEST_URL` | Provided automatically by the GitHub Actions runtime |
518+
| `ACTIONS_ID_TOKEN_REQUEST_TOKEN` | Provided automatically by the GitHub Actions runtime |
519+
520+
### Optional environment variables
521+
522+
| Variable | Default | Description |
523+
|----------|---------|-------------|
524+
| `AWF_AUTH_OIDC_AUDIENCE` | `api://AzureADTokenExchange` | Audience for the GitHub OIDC token |
525+
| `AWF_AUTH_AZURE_SCOPE` | `https://cognitiveservices.azure.com/.default` | Azure token scope |
526+
| `AWF_AUTH_AZURE_CLOUD` | `public` | Azure cloud environment (`public`, `usgovernment`, or `china`) |
527+
528+
### GitHub Actions example
529+
530+
```yaml
531+
jobs:
532+
agent:
533+
permissions:
534+
id-token: write # required for OIDC token request
535+
contents: read
536+
steps:
537+
- name: Run agent with Azure OpenAI
538+
env:
539+
AWF_AUTH_TYPE: github-oidc
540+
AWF_AUTH_AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
541+
AWF_AUTH_AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
542+
OPENAI_API_TARGET: my-deployment.openai.azure.com
543+
run: |
544+
sudo --preserve-env=AWF_AUTH_TYPE,AWF_AUTH_AZURE_TENANT_ID,AWF_AUTH_AZURE_CLIENT_ID,OPENAI_API_TARGET \
545+
awf --enable-api-proxy \
546+
--openai-api-target my-deployment.openai.azure.com \
547+
--allow-domains my-deployment.openai.azure.com \
548+
-- your-agent-command
549+
```
550+
551+
:::note
552+
`ACTIONS_ID_TOKEN_REQUEST_URL` and `ACTIONS_ID_TOKEN_REQUEST_TOKEN` are injected by the Actions runner automatically; AWF forwards them to the sidecar when `AWF_AUTH_TYPE=github-oidc`.
553+
:::
554+
555+
:::caution
556+
Azure OpenAI deployments use a different base URL format from OpenAI. Set `--openai-api-target` to your Azure endpoint hostname and add it to `--allow-domains`.
557+
:::
558+
497559
## Limitations
498560

499561
- Keys must be set as environment variables (not file-based)
500-
- No support for Azure OpenAI endpoints (use `--openai-api-target` for custom endpoints)
501562
- No request/response logging (by design, for security)
502563

503564
## Related documentation

0 commit comments

Comments
 (0)