From 171ab4b205ec878667dcd2878c7ec174195bfeab Mon Sep 17 00:00:00 2001 From: Ge Gao <49388944+dorisjoy@users.noreply.github.com> Date: Sun, 28 Apr 2024 09:37:22 +0800 Subject: [PATCH] get portal_url from result instead of construct them (#2777) * get portal_url from result instead of construct them * add .pyc to cspell.json * refine * Refine --------- Co-authored-by: Ge Gao --- assets/promptflow/.cspell.json | 1 + scripts/promptflow-ci/utils/flow_utils.py | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/assets/promptflow/.cspell.json b/assets/promptflow/.cspell.json index b3ae97f41f..5891abf835 100644 --- a/assets/promptflow/.cspell.json +++ b/assets/promptflow/.cspell.json @@ -156,6 +156,7 @@ ], "ignorePaths":[ "**.py", + "**.pyc", "**.jinja2", "**.txt", "**.json", diff --git a/scripts/promptflow-ci/utils/flow_utils.py b/scripts/promptflow-ci/utils/flow_utils.py index a046ca4ee1..c4405fad92 100644 --- a/scripts/promptflow-ci/utils/flow_utils.py +++ b/scripts/promptflow-ci/utils/flow_utils.py @@ -107,12 +107,13 @@ def get_run_id_and_url(res, sub, rg, ws): match = re.search(r'"name": "(.*?)",', line) if match: run_id = match.group(1) - portal_url = ( - f"https://ml.azure.com/prompts/flow/bulkrun/run/{run_id}/details" - f"?wsid=/subscriptions/{sub}/resourceGroups/{rg}/providers" - f"/Microsoft.MachineLearningServices/workspaces/{ws}" - ) log_debug(f"runId: {run_id}") + + if ('"portal_url":' in line): + match = re.search(r'"portal_url": "(.*?)",', line) + if match: + portal_url = match.group(1) + log_debug(f"portal_url: {portal_url}") return run_id, portal_url