diff --git a/ResearchAssistant/Deployment/scripts/aihub_scripts/create_ai_hub.py b/ResearchAssistant/Deployment/scripts/aihub_scripts/create_ai_hub.py index 0ae6db694..cf0b8c3a6 100644 --- a/ResearchAssistant/Deployment/scripts/aihub_scripts/create_ai_hub.py +++ b/ResearchAssistant/Deployment/scripts/aihub_scripts/create_ai_hub.py @@ -1,7 +1,6 @@ # Get Azure Key Vault Client key_vault_name = 'kv_to-be-replaced' -import time from azure.ai.ml import MLClient from azure.ai.ml.entities import ( Hub, @@ -74,10 +73,7 @@ def get_secrets_from_kv(kv_name, secret_name): # construct a hub my_hub = Hub(name=aihub_name, location=solutionLocation, display_name=aihub_name) -created_hub = ml_client.workspaces.begin_create(my_hub) - -time.sleep(60) # wait for hub to be created -created_hub = ml_client.workspaces.get(name=aihub_name) +created_hub = ml_client.workspaces.begin_create(my_hub).result() # construct the project my_project = Project( @@ -87,9 +83,7 @@ def get_secrets_from_kv(kv_name, secret_name): hub_id=created_hub.id, ) -created_project = ml_client.workspaces.begin_create(workspace=my_project) - -time.sleep(30) # wait for hub to be created +created_project = ml_client.workspaces.begin_create(workspace=my_project).result() open_ai_connection = AzureOpenAIConnection( name="Azure_OpenAI", diff --git a/ResearchAssistant/Deployment/scripts/aihub_scripts/requirements.txt b/ResearchAssistant/Deployment/scripts/aihub_scripts/requirements.txt index f1930f449..98acb23ae 100644 --- a/ResearchAssistant/Deployment/scripts/aihub_scripts/requirements.txt +++ b/ResearchAssistant/Deployment/scripts/aihub_scripts/requirements.txt @@ -1,7 +1,7 @@ azure-identity azure-keyvault-secrets azure-ai-resources -azure-ai-ml==1.24.0 +azure-ai-ml==1.26.1 msal[broker]==1.24.0b1 azure-mgmt-resource==23.1.0b2 azure-mgmt-cognitiveservices