Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion open_notebook/ai/connection_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ async def test_provider_connection(
return await _test_openai_compatible_connection(test_base_url, test_api_key)

if normalized_provider == "azure":
return await _test_azure_connection(endpoint, api_key, api_version)
# For Azure, base_url from the UI form maps to endpoint
azure_endpoint = endpoint or base_url
return await _test_azure_connection(azure_endpoint, api_key, api_version)

# Get test model for provider
if normalized_provider not in TEST_MODELS:
Expand Down
6 changes: 4 additions & 2 deletions open_notebook/ai/key_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,10 @@ async def _provision_azure() -> bool:
os.environ["AZURE_OPENAI_API_VERSION"] = cred.api_version
logger.debug("Set AZURE_OPENAI_API_VERSION from Credential")
any_set = True
if cred.endpoint:
os.environ["AZURE_OPENAI_ENDPOINT"] = cred.endpoint
# For Azure, base_url from the UI form maps to endpoint
azure_endpoint = cred.endpoint or cred.base_url
if azure_endpoint:
os.environ["AZURE_OPENAI_ENDPOINT"] = azure_endpoint
logger.debug("Set AZURE_OPENAI_ENDPOINT from Credential")
any_set = True
if cred.endpoint_llm:
Expand Down
3 changes: 3 additions & 0 deletions open_notebook/domain/credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ def to_esperanto_config(self) -> Dict[str, Any]:
config["api_key"] = self.api_key.get_secret_value()
if self.base_url:
config["base_url"] = self.base_url
# For Azure, base_url from the UI form maps to endpoint

@cubic-dev-ai cubic-dev-ai Bot Apr 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Update the Azure credential docs to reflect that the UI “URL Base”/base_url field maps to the Azure endpoint (and that a dedicated Endpoint field is not required when base_url is provided).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At open_notebook/domain/credential.py, line 79:

<comment>Update the Azure credential docs to reflect that the UI “URL Base”/base_url field maps to the Azure endpoint (and that a dedicated Endpoint field is not required when base_url is provided).</comment>

<file context>
@@ -76,6 +76,9 @@ def to_esperanto_config(self) -> Dict[str, Any]:
             config["api_key"] = self.api_key.get_secret_value()
         if self.base_url:
             config["base_url"] = self.base_url
+            # For Azure, base_url from the UI form maps to endpoint
+            if self.provider and self.provider.lower() == "azure" and not self.endpoint:
+                config["endpoint"] = self.base_url
</file context>
Fix with Cubic

if self.provider and self.provider.lower() == "azure" and not self.endpoint:
config["endpoint"] = self.base_url
if self.endpoint:
config["endpoint"] = self.endpoint
if self.api_version:
Expand Down
Loading