Skip to content

Commit 9bf99d3

Browse files
authored
Ai connections merge (#35302)
* stash * add 2024 April preview swagger and restclients * add new subtype support to schema, entity, and operations * add testing * changelog and cspell * e2e test recordings * use newer import * spelling corrections * minor adjustments * update recordings * add resource id to azure open ai conn * add more valid cred types to some connections * add another cred * remove accidental import * rename workspace connectino to connection * test corrections * sphinx corrections * correct tests one more time * cspell * analyze fixes * comments
1 parent 24562c6 commit 9bf99d3

File tree

230 files changed

+204729
-2020
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+204729
-2020
lines changed

sdk/ml/azure-ai-ml/CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,24 @@
33
## 1.16.0 (unreleased)
44

55
### Features Added
6-
6+
- Many changes to the Connection entity class and its associated operations.
7+
- Workspace Connection `list`, `get`, and `create_or_update` operations now include an optional `populate_secrets` input, which causes the operations to try making a secondary call to fill in the returned connections' credential info if possible. Only works with api key-based credentials for now.
8+
- Many workspace connection subtypes added. The full list of subclasses is now:
9+
- `AzureBlobStoreConnection`
10+
- `AzureBlobStoreConnection`
11+
- `MicrosoftOneLakeConnection`
12+
- `AzureOpenAIConnection`
13+
- `AzureAIServicesConnection`
14+
- `AzureAISearchConnection`
15+
- `AzureContentSafetyConnection`
16+
- `AzureSpeechServicesConnection`
17+
- `APIKeyConnection`
18+
- `OpenAIConnection`
19+
- `SerpConnection`
20+
- `ServerlessConnection`
21+
- Many workspace connections only accept api keys or entra ids for credentials. Since Entra IDs require not inputs, these have been refactored to not required a full credential object. Instead they only accept an api_key as a top-level input, and default to an entra credential otherwise. Their YAML schemas have been similarly altered.
22+
- Client-side credential-type validation added for some workspace connection types.
23+
- Added new credential type: `AadCredentialConfiguration`
724
- Renamed WorkspaceHub class as Hub.
825
- Added Project entity class and YAML support.
926
- Project and Hub operations supported by workspace operations.
@@ -15,6 +32,7 @@
1532

1633
### Breaking Changes
1734

35+
- WorkspaceConnection and subclasses renamed to just Connection
1836
- Removed WorkspaceHubConfig entity, and renamed WorkspaceHub to Hub.
1937
- workspace_hub input of Workspace class hidden, renamed to hub_id, and re-surfaced in child class Project.
2038
- Removed Workspace Hub Operations from ML Client.

sdk/ml/azure-ai-ml/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/ml/azure-ai-ml",
5-
"Tag": "python/ml/azure-ai-ml_cfba1d7771"
5+
"Tag": "python/ml/azure-ai-ml_6ac7667166"
66
}

sdk/ml/azure-ai-ml/azure/ai/ml/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
load_online_endpoint,
3535
load_registry,
3636
load_workspace,
37-
load_workspace_connection,
37+
load_connection,
3838
)
3939

4040
module_logger = logging.getLogger(__name__)
@@ -67,7 +67,7 @@
6767
"load_online_endpoint",
6868
"load_workspace",
6969
"load_registry",
70-
"load_workspace_connection",
70+
"load_connection",
7171
"load_model_package",
7272
]
7373

sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
# Same object, but was renamed starting in v2023_08_01_preview
3838
from azure.ai.ml._restclient.v2023_10_01 import AzureMachineLearningServices as ServiceClient102023
3939
from azure.ai.ml._restclient.v2024_01_01_preview import AzureMachineLearningWorkspaces as ServiceClient012024Preview
40+
from azure.ai.ml._restclient.v2024_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient042024Preview
4041
from azure.ai.ml._restclient.workspace_dataplane import (
4142
AzureMachineLearningWorkspaces as ServiceClientWorkspaceDataplane,
4243
)
@@ -82,7 +83,7 @@
8283
OnlineDeploymentOperations,
8384
OnlineEndpointOperations,
8485
RegistryOperations,
85-
WorkspaceConnectionsOperations,
86+
ConnectionsOperations,
8687
WorkspaceOperations,
8788
)
8889
from azure.ai.ml.operations._code_operations import CodeOperations
@@ -438,6 +439,17 @@ def __init__(
438439
**kwargs,
439440
)
440441

442+
self._service_client_04_2024_preview = ServiceClient042024Preview(
443+
credential=self._credential,
444+
subscription_id=(
445+
self._ws_operation_scope._subscription_id
446+
if registry_reference
447+
else self._operation_scope._subscription_id
448+
),
449+
base_url=base_url,
450+
**kwargs,
451+
)
452+
441453
self._workspaces = WorkspaceOperations(
442454
self._ws_operation_scope if registry_reference else self._operation_scope,
443455
self._service_client_08_2023_preview,
@@ -467,10 +479,10 @@ def __init__(
467479
)
468480
self._operation_container.add(AzureMLResourceType.REGISTRY, self._registries) # type: ignore[arg-type]
469481

470-
self._workspace_connections = WorkspaceConnectionsOperations(
482+
self._connections = ConnectionsOperations(
471483
self._operation_scope,
472484
self._operation_config,
473-
self._service_client_08_2023_preview,
485+
self._service_client_04_2024_preview,
474486
self._operation_container,
475487
self._credential,
476488
)
@@ -867,13 +879,13 @@ def feature_store_entities(self) -> FeatureStoreEntityOperations:
867879
return self._featurestoreentities
868880

869881
@property
870-
def connections(self) -> WorkspaceConnectionsOperations:
871-
"""A collection of workspace connection related operations.
882+
def connections(self) -> ConnectionsOperations:
883+
"""A collection of connection related operations.
872884
873-
:return: Workspace Connections operations
874-
:rtype: ~azure.ai.ml.operations.WorkspaceConnectionsOperations
885+
:return: Connections operations
886+
:rtype: ~azure.ai.ml.operations.ConnectionsOperations
875887
"""
876-
return self._workspace_connections
888+
return self._connections
877889

878890
@property
879891
def jobs(self) -> JobOperations:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces
10+
from ._version import VERSION
11+
12+
__version__ = VERSION
13+
__all__ = ['AzureMachineLearningWorkspaces']
14+
15+
# `._patch.py` is used for handwritten extensions to the generated code
16+
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
17+
from ._patch import patch_sdk
18+
patch_sdk()

0 commit comments

Comments
 (0)