|
11 | 11 | ) |
12 | 12 | from azure.keyvault.secrets import SecretClient |
13 | 13 | from azure.identity import DefaultAzureCredential |
14 | | -from azure.mgmt import search as Se |
15 | | - |
16 | 14 |
|
17 | 15 | def get_secrets_from_kv(kv_name, secret_name): |
18 | 16 | # Set the name of the Azure Key Vault |
@@ -64,8 +62,9 @@ def get_secrets_from_kv(kv_name, secret_name): |
64 | 62 | # Credentials |
65 | 63 | credential = DefaultAzureCredential() |
66 | 64 |
|
67 | | -# Create the ML CLient |
| 65 | +# Create an ML client |
68 | 66 | ml_client = MLClient( |
| 67 | + workspace_name=aihub_name, |
69 | 68 | resource_group_name=resource_group_name, |
70 | 69 | subscription_id=subscription_id, |
71 | 70 | credential=credential, |
@@ -94,21 +93,9 @@ def get_secrets_from_kv(kv_name, secret_name): |
94 | 93 | open_ai_resource_id=f"/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Search/searchServices/{ai_search_res_name}", |
95 | 94 | ) |
96 | 95 |
|
97 | | -# Create an ML client |
98 | | -ml_client = MLClient( |
99 | | - workspace_name=aihub_name, |
100 | | - resource_group_name=resource_group_name, |
101 | | - subscription_id=subscription_id, |
102 | | - credential=credential, |
103 | | -) |
104 | | - |
105 | 96 | ml_client.connections.create_or_update(open_ai_connection) |
106 | 97 |
|
107 | 98 | # Create AI Search resource |
108 | | -search_client = Se.SearchManagementClient( |
109 | | - credential=credential, subscription_id=subscription_id |
110 | | -) |
111 | | - |
112 | 99 | aisearch_connection = AzureAISearchConnection( |
113 | 100 | name=ai_search_res_name, |
114 | 101 | endpoint=ai_search_endpoint, |
|
0 commit comments