Skip to content

Commit 1144778

Browse files
authored
Hub arm updates may 2024 (Azure#35457)
* ai services create arg * pylint and such * run black again * change connection kind name * use new assets for connections * fix project arm template * remove ai_serives from workspace create
1 parent bba0c81 commit 1144778

File tree

8 files changed

+12
-112
lines changed

8 files changed

+12
-112
lines changed

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_6ac7667166"
5+
"Tag": "python/ml/azure-ai-ml_ea5ddd9a5f"
66
}

sdk/ml/azure-ai-ml/azure/ai/ml/_arm_deployments/arm_templates/workspace_base.json

Lines changed: 4 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@
119119
},
120120
"applicationInsightsOption": {
121121
"type": "string",
122-
"defaultValue": "new",
122+
"defaultValue": "none",
123123
"allowedValues": [
124-
"new",
124+
"none",
125125
"existing"
126126
],
127127
"metadata": {
@@ -161,7 +161,6 @@
161161
"type": "string",
162162
"defaultValue": "none",
163163
"allowedValues": [
164-
"new",
165164
"existing",
166165
"none"
167166
],
@@ -778,52 +777,6 @@
778777
"networkAcls": "[if(equals(parameters('keyVaultBehindVNet'), 'true'), variables('networkRuleSetBehindVNet'), json('null'))]"
779778
}
780779
},
781-
{
782-
"condition": "[and(variables('enablePE'), equals(parameters('containerRegistryOption'), 'new'))]",
783-
"type": "Microsoft.ContainerRegistry/registries",
784-
"apiVersion": "2019-05-01",
785-
"tags": "[parameters('tagValues')]",
786-
"name": "[parameters('containerRegistryName')]",
787-
"dependsOn": [
788-
"[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]"
789-
],
790-
"location": "[parameters('containerRegistryLocation')]",
791-
"sku": {
792-
"name": "[parameters('containerRegistrySku')]"
793-
},
794-
"properties": {
795-
"adminUserEnabled": true,
796-
"networkRuleSet": "[if(equals(parameters('containerRegistryBehindVNet'), 'true'), variables('networkRuleSetBehindVNet'), json('null'))]"
797-
}
798-
},
799-
{
800-
"condition": "[and(variables('enablePE'), equals(parameters('applicationInsightsOption'), 'new'))]",
801-
"type": "Microsoft.OperationalInsights/workspaces",
802-
"tags": "[parameters('tagValues')]",
803-
"apiVersion": "2020-08-01",
804-
"name": "[parameters('logAnalyticsName')]",
805-
"location": "[if(or(equals(toLower(parameters('applicationInsightsLocation')),'westcentralus'), equals(toLower(parameters('applicationInsightsLocation')),'eastus2euap'), equals(toLower(parameters('applicationInsightsLocation')),'centraluseuap')),'southcentralus', parameters('applicationInsightsLocation'))]",
806-
"kind": "web",
807-
"properties": {
808-
"Application_Type": "web"
809-
}
810-
},
811-
{
812-
"condition": "[and(variables('enablePE'), equals(parameters('applicationInsightsOption'), 'new'))]",
813-
"type": "Microsoft.Insights/components",
814-
"tags": "[parameters('tagValues')]",
815-
"apiVersion": "2020-02-02-preview",
816-
"name": "[parameters('applicationInsightsName')]",
817-
"location": "[if(or(equals(toLower(parameters('applicationInsightsLocation')),'westcentralus'), equals(toLower(parameters('applicationInsightsLocation')),'eastus2euap'), equals(toLower(parameters('applicationInsightsLocation')),'centraluseuap')),'southcentralus', parameters('applicationInsightsLocation'))]",
818-
"kind": "web",
819-
"dependsOn": [
820-
"[resourceId('Microsoft.OperationalInsights/workspaces', parameters('logAnalyticsName'))]"
821-
],
822-
"properties": {
823-
"Application_Type": "web",
824-
"WorkspaceResourceId": "[parameters('logAnalyticsArmId')]"
825-
}
826-
},
827780
{
828781
"condition": "[variables('enablePE')]",
829782
"type": "Microsoft.MachineLearningServices/workspaces",
@@ -834,9 +787,7 @@
834787
"location": "[parameters('location')]",
835788
"dependsOn": [
836789
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]",
837-
"[resourceId('Microsoft.KeyVault/vaults', parameters('keyVaultName'))]",
838-
"[resourceId('Microsoft.Insights/components', parameters('applicationInsightsName'))]",
839-
"[resourceId('Microsoft.ContainerRegistry/registries', parameters('containerRegistryName'))]"
790+
"[resourceId('Microsoft.KeyVault/vaults', parameters('keyVaultName'))]"
840791
],
841792
"identity": "[parameters('identity')]",
842793
"properties": {
@@ -846,6 +797,7 @@
846797
"keyVault": "[variables('keyVault')]",
847798
"applicationInsights": "[variables('applicationInsights')]",
848799
"containerRegistry": "[if(not(equals(parameters('containerRegistryOption'), 'none')), variables('containerRegistry'), json('null'))]",
800+
"applicationInsights": "[if(not(equals(parameters('applicationInsightsOption'), 'none')), variables('containerRegistry'), json('null'))]",
849801
"hbiWorkspace": "[parameters('confidential_data')]",
850802
"imageBuildCompute": "[parameters('imageBuildCompute')]",
851803
"publicNetworkAccess": "[parameters('publicNetworkAccess')]",
@@ -920,48 +872,6 @@
920872
"resourceid": "[variables('materializationIdentity')]"
921873
}
922874
}
923-
},
924-
{
925-
"condition": "[and(equals(parameters('endpoint_option'), 'new'), variables('isWorkspaceHub'))]",
926-
"type": "endpoints",
927-
"apiVersion": "2023-08-01-preview",
928-
"name": "Azure.OpenAI",
929-
"properties": {
930-
"name": "Azure.OpenAI",
931-
"endpointType": "Azure.OpenAI",
932-
"associatedResourceId": "[if(equals(parameters('endpoint_resource_id'), 'null'), null(), parameters('endpoint_resource_id'))]"
933-
},
934-
"dependsOn": [
935-
"[parameters('workspaceName')]"
936-
]
937-
},
938-
{
939-
"condition": "[and(equals(parameters('endpoint_kind'), 'AIServices'), equals(parameters('endpoint_option'), 'new'), variables('isWorkspaceHub'))]",
940-
"type": "endpoints",
941-
"apiVersion": "2023-08-01-preview",
942-
"name": "Azure.ContentSafety",
943-
"properties": {
944-
"name": "Azure.ContentSafety",
945-
"endpointType": "Azure.ContentSafety",
946-
"associatedResourceId": "[if(equals(parameters('endpoint_resource_id'), 'null'), null(), parameters('endpoint_resource_id'))]"
947-
},
948-
"dependsOn": [
949-
"[parameters('workspaceName')]"
950-
]
951-
},
952-
{
953-
"condition": "[and(equals(parameters('endpoint_kind'), 'AIServices'), equals(parameters('endpoint_option'), 'new'), variables('isWorkspaceHub'))]",
954-
"type": "endpoints",
955-
"apiVersion": "2023-08-01-preview",
956-
"name": "Azure.Speech",
957-
"properties": {
958-
"name": "Azure.Speech",
959-
"endpointType": "Azure.Speech",
960-
"associatedResourceId": "[if(equals(parameters('endpoint_resource_id'), 'null'), null(), parameters('endpoint_resource_id'))]"
961-
},
962-
"dependsOn": [
963-
"[parameters('workspaceName')]"
964-
]
965875
}
966876
]
967877
},

sdk/ml/azure-ai-ml/azure/ai/ml/_arm_deployments/arm_templates/workspace_param.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"value": ""
4040
},
4141
"applicationInsightsOption": {
42-
"value": "new"
42+
"value": "none"
4343
},
4444
"applicationInsightsName": {
4545
"value": ""

sdk/ml/azure-ai-ml/azure/ai/ml/_arm_deployments/arm_templates/workspace_project.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@
119119
},
120120
"applicationInsightsOption": {
121121
"type": "string",
122-
"defaultValue": "new",
122+
"defaultValue": "none",
123123
"allowedValues": [
124-
"new",
124+
"none",
125125
"existing"
126126
],
127127
"metadata": {
@@ -161,7 +161,6 @@
161161
"type": "string",
162162
"defaultValue": "none",
163163
"allowedValues": [
164-
"new",
165164
"existing",
166165
"none"
167166
],

sdk/ml/azure-ai-ml/azure/ai/ml/constants/_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,10 +841,10 @@ class OneLakeArtifactTypes:
841841

842842

843843
class CognitiveServiceKinds:
844-
"""Subtypes for connections using the Cognitive serive type. These
844+
"""Subtypes for connections using the Cognitive service type. These
845845
values are plugged into the connection's metadata."""
846846

847-
CONTENT_SAFETY = "content_safety"
847+
CONTENT_SAFETY = "Content Safety"
848848
SPEECH = "speech"
849849

850850

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,9 +595,9 @@ def _get_entity_class_from_rest_obj(cls, rest_obj: RestWorkspaceConnection) -> T
595595
and rest_obj.properties.metadata is not None
596596
):
597597
kind = rest_obj.properties.metadata.get(CONNECTION_KIND_KEY, "").lower()
598-
if kind == CognitiveServiceKinds.CONTENT_SAFETY:
598+
if kind == CognitiveServiceKinds.CONTENT_SAFETY.lower():
599599
return AzureContentSafetyConnection
600-
if kind == CognitiveServiceKinds.SPEECH:
600+
if kind == CognitiveServiceKinds.SPEECH.lower():
601601
return AzureSpeechServicesConnection
602602
return Connection
603603

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/connection_subtypes.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,6 @@ class AzureContentSafetyConnection(ApiOrAadConnection):
518518
:type tags: dict
519519
"""
520520

521-
# kinds AzureOpenAI", "ContentSafety", and "Speech"
522-
523521
def __init__(
524522
self,
525523
**kwargs: Any,

sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_operations_base.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -740,13 +740,6 @@ def _populate_arm_parameters(self, workspace: Workspace, **kwargs: Any) -> Tuple
740740
_set_val(param["endpoint_resource_id"], endpoint_resource_id)
741741
_set_val(param["endpoint_kind"], endpoint_kind)
742742

743-
# Hubs must have an azure container registry on-provision. If none was provided, create one.
744-
if not workspace.container_registry:
745-
_set_val(param["containerRegistryOption"], "new")
746-
container_registry = _generate_container_registry(workspace.name, resources_being_deployed)
747-
_set_val(param["containerRegistryName"], container_registry)
748-
_set_val(param["containerRegistryResourceGroupName"], self._resource_group_name)
749-
750743
# Lean related param
751744
if (
752745
hasattr(workspace, "_kind")

0 commit comments

Comments
 (0)