diff --git a/python/packages/devui/agent_framework_devui/_deployment.py b/python/packages/devui/agent_framework_devui/_deployment.py index e1cf1d5c3d..45f99a315a 100644 --- a/python/packages/devui/agent_framework_devui/_deployment.py +++ b/python/packages/devui/agent_framework_devui/_deployment.py @@ -10,6 +10,7 @@ import uuid from collections.abc import AsyncGenerator from datetime import datetime, timezone from pathlib import Path +from urllib.parse import urlparse from .models._discovery_models import Deployment, DeploymentConfig, DeploymentEvent @@ -467,11 +468,18 @@ CMD ["devui", "/app/entity", "--mode", "{config.ui_mode}", "--host", "0.0.0.0", await event_queue.put( DeploymentEvent(type="deploy.progress", message=f"Docker build: {line_text}") ) - elif "https://" in line_text and ".azurecontainerapps.io" in line_text: - # Deployment URL detected - await event_queue.put( - DeploymentEvent(type="deploy.progress", message="Deployment URL generated!") - ) + elif "https://" in line_text: + # Try to extract all URLs and check if any is on azurecontainerapps.io + urls = re.findall(r'https://[^\s<>"]+', line_text) + for url in urls: + # Strip common trailing punctuation to ensure clean URL parsing + url_clean = url.rstrip(".,;:!?'\")}]") + host = urlparse(url_clean).hostname + if host and (host == "azurecontainerapps.io" or host.endswith(".azurecontainerapps.io")): + await event_queue.put( + DeploymentEvent(type="deploy.progress", message="Deployment URL generated!") + ) + break # Wait for process to complete return_code = await process.wait()