Skip to content

fix: Make Azure OpenAI API key optional to match documentation#6215

Merged
jamadeo merged 1 commit intoblock:mainfrom
albina-popova:fix/azure-optional-api-key
Jan 5, 2026
Merged

fix: Make Azure OpenAI API key optional to match documentation#6215
jamadeo merged 1 commit intoblock:mainfrom
albina-popova:fix/azure-optional-api-key

Conversation

@albina-popova
Copy link
Contributor

Summary

  • Makes AZURE_OPENAI_API_KEY optional instead of required in the Azure OpenAI provider configuration
  • Aligns the implementation with the official documentation which states the API key is optional
  • When no API key is provided, the provider falls back to Azure credential chain authentication (Azure CLI, managed identity, etc.)

Changes

Single line change in crates/goose/src/providers/azure.rs:

  • ConfigKey::new("AZURE_OPENAI_API_KEY", true, true, Some(""))ConfigKey::new("AZURE_OPENAI_API_KEY", false, true, Some(""))

The underlying code at lines 81-84 already handles optional API keys correctly using .ok() and .filter().

Test plan

  • Verified via CLI: goose configure no longer requires API key for Azure OpenAI
  • Verified via Desktop GUI: Can configure Azure OpenAI without API key
  • Verified authentication works using Azure credential chain (Azure CLI)
  • Backward compatible: API key authentication still works when provided

🤖 Generated with Claude Code

The documentation at https://block.github.io/goose/docs/getting-started/providers/
lists AZURE_OPENAI_API_KEY as optional, but the implementation required it.
This change makes the implementation match the documentation.

When no API key is provided, the Azure provider falls back to Azure
credential chain authentication (Azure CLI, managed identity, etc.).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: albina-popova <97168987+albina-popova@users.noreply.github.com>
@jamadeo jamadeo merged commit 4a08ad5 into block:main Jan 5, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments