File tree 1 file changed +8
-2
lines changed
ResearchAssistant/Deployment/scripts/aihub_scripts
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
# Get Azure Key Vault Client
2
2
key_vault_name = 'kv_to-be-replaced'
3
3
4
+ import time
4
5
from azure .ai .ml import MLClient
5
6
from azure .ai .ml .entities import (
6
7
Hub ,
@@ -73,7 +74,10 @@ def get_secrets_from_kv(kv_name, secret_name):
73
74
# construct a hub
74
75
my_hub = Hub (name = aihub_name , location = solutionLocation , display_name = aihub_name )
75
76
76
- created_hub = ml_client .workspaces .begin_create (my_hub ).result ()
77
+ created_hub = ml_client .workspaces .begin_create (my_hub )
78
+
79
+ time .sleep (60 ) # wait for hub to be created
80
+ created_hub = ml_client .workspaces .get (name = aihub_name )
77
81
78
82
# construct the project
79
83
my_project = Project (
@@ -83,7 +87,9 @@ def get_secrets_from_kv(kv_name, secret_name):
83
87
hub_id = created_hub .id ,
84
88
)
85
89
86
- created_project = ml_client .workspaces .begin_create (workspace = my_project ).result ()
90
+ created_project = ml_client .workspaces .begin_create (workspace = my_project )
91
+
92
+ time .sleep (30 ) # wait for hub to be created
87
93
88
94
open_ai_connection = AzureOpenAIConnection (
89
95
name = "Azure_OpenAI" ,
You can’t perform that action at this time.
0 commit comments