Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Modules] Updated & extended ML Workspaces API version #2240

Merged
merged 3 commits into from
Oct 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var builtInRoleNames = {
'User Access Administrator': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '18d7d88d-d35e-4fb5-a5c3-7773c20a72d9')
}

resource workspace 'Microsoft.MachineLearningServices/workspaces@2021-04-01' existing = {
resource workspace 'Microsoft.MachineLearningServices/workspaces@2022-05-01' existing = {
name: last(split(resourceId, '/'))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ param location string = resourceGroup().location
param virtualNetworkName string

@description('Required. The name of the Key Vault to create.')
@minLength(3)
@maxLength(24)
param keyVaultName string

@description('Required. The name of the Managed Identity to create.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ param resourceGroupName string = 'ms.machinelearningservices.workspaces-${servic
param location string = deployment().location

@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.')
param serviceShort string = 'mlswencr'
param serviceShort string = 'mlswecr'

@description('Generated. Used as a basis for unique resource names.')
param baseTime string = utcNow('u')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ var identity = identityType != 'None' ? {
// ============================= //
// Existing resources references //
// ============================= //
resource machineLearningWorkspace 'Microsoft.MachineLearningServices/workspaces@2021-04-01' existing = {
resource machineLearningWorkspace 'Microsoft.MachineLearningServices/workspaces@2022-05-01' existing = {
name: machineLearningWorkspaceName
}

Expand All @@ -98,7 +98,7 @@ resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (ena
}
}

resource machineLearningWorkspaceCompute 'Microsoft.MachineLearningServices/workspaces/computes@2022-01-01-preview' = if (deployCompute == true) {
resource machineLearningWorkspaceCompute 'Microsoft.MachineLearningServices/workspaces/computes@2022-05-01' = if (deployCompute == true) {
name: name
location: location
tags: empty(resourceId) ? tags : any(null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Attaching a compute is not idempotent and will fail in case you try to redeploy

| Resource Type | API Version |
| :-- | :-- |
| `Microsoft.MachineLearningServices/workspaces/computes` | [2022-01-01-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.MachineLearningServices/2022-01-01-preview/workspaces/computes) |
| `Microsoft.MachineLearningServices/workspaces/computes` | [2022-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.MachineLearningServices/2022-05-01/workspaces/computes) |

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ param location string = resourceGroup().location

@sys.description('Required. Specifies the SKU, also referred as \'edition\' of the Azure Machine Learning workspace.')
@allowed([
'Free'
'Basic'
'Standard'
'Enterprise'
])
param sku string
Expand Down Expand Up @@ -131,6 +133,12 @@ param imageBuildCompute string = ''
@sys.description('Conditional. The user assigned identity resource ID that represents the workspace identity. Required if \'userAssignedIdentities\' is not empty and may not be used if \'systemAssignedIdentity\' is enabled.')
param primaryUserAssignedIdentity string = ''

@sys.description('Optional. The service managed resource settings.')
param serviceManagedResourcesSettings object = {}

@sys.description('Optional. The list of shared private link resources in this workspace.')
param sharedPrivateLinkResources array = []

@sys.description('Optional. Whether or not public network access is allowed for this resource. For security reasons it should be disabled. If not specified, it will be disabled by default if private endpoints are set.')
@allowed([
''
Expand Down Expand Up @@ -190,7 +198,7 @@ resource cMKKeyVaultKey 'Microsoft.KeyVault/vaults/keys@2021-10-01' existing = i
scope: resourceGroup(split(cMKKeyVaultResourceId, '/')[2], split(cMKKeyVaultResourceId, '/')[4])
}

resource workspace 'Microsoft.MachineLearningServices/workspaces@2021-07-01' = {
resource workspace 'Microsoft.MachineLearningServices/workspaces@2022-05-01' = {
name: name
location: location
tags: tags
Expand Down Expand Up @@ -222,6 +230,8 @@ resource workspace 'Microsoft.MachineLearningServices/workspaces@2021-07-01' = {
imageBuildCompute: imageBuildCompute
primaryUserAssignedIdentity: primaryUserAssignedIdentity
publicNetworkAccess: !empty(publicNetworkAccess) ? any(publicNetworkAccess) : (!empty(privateEndpoints) ? 'Disabled' : 'Enabled')
serviceManagedResourcesSettings: serviceManagedResourcesSettings
sharedPrivateLinkResources: sharedPrivateLinkResources
}
}

Expand Down
14 changes: 8 additions & 6 deletions modules/Microsoft.MachineLearningServices/workspaces/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ This module deploys a Machine Learning Services Workspace.
| `Microsoft.Authorization/locks` | [2017-04-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2017-04-01/locks) |
| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
| `Microsoft.Insights/diagnosticSettings` | [2021-05-01-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Insights/2021-05-01-preview/diagnosticSettings) |
| `Microsoft.MachineLearningServices/workspaces` | [2021-07-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.MachineLearningServices/2021-07-01/workspaces) |
| `Microsoft.MachineLearningServices/workspaces/computes` | [2022-01-01-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.MachineLearningServices/2022-01-01-preview/workspaces/computes) |
| `Microsoft.MachineLearningServices/workspaces` | [2022-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.MachineLearningServices/2022-05-01/workspaces) |
| `Microsoft.MachineLearningServices/workspaces/computes` | [2022-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.MachineLearningServices/2022-05-01/workspaces/computes) |
| `Microsoft.Network/privateEndpoints` | [2021-08-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Network/2021-08-01/privateEndpoints) |
| `Microsoft.Network/privateEndpoints/privateDnsZoneGroups` | [2021-08-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Network/2021-08-01/privateEndpoints/privateDnsZoneGroups) |

Expand All @@ -32,7 +32,7 @@ This module deploys a Machine Learning Services Workspace.
| `associatedKeyVaultResourceId` | string | | The resource ID of the associated Key Vault. |
| `associatedStorageAccountResourceId` | string | | The resource ID of the associated Storage Account. |
| `name` | string | | The name of the machine learning workspace. |
| `sku` | string | `[Basic, Enterprise]` | Specifies the SKU, also referred as 'edition' of the Azure Machine Learning workspace. |
| `sku` | string | `[Basic, Enterprise, Free, Standard]` | Specifies the SKU, also referred as 'edition' of the Azure Machine Learning workspace. |

**Conditional parameters**

Expand Down Expand Up @@ -71,6 +71,8 @@ This module deploys a Machine Learning Services Workspace.
| `privateEndpoints` | array | `[]` | | Configuration details for private endpoints. For security reasons, it is recommended to use private endpoints whenever possible. |
| `publicNetworkAccess` | string | `''` | `['', Disabled, Enabled]` | Whether or not public network access is allowed for this resource. For security reasons it should be disabled. If not specified, it will be disabled by default if private endpoints are set. |
| `roleAssignments` | array | `[]` | | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
| `serviceManagedResourcesSettings` | object | `{object}` | | The service managed resource settings. |
| `sharedPrivateLinkResources` | array | `[]` | | The list of shared private link resources in this workspace. |
| `tags` | object | `{object}` | | Resource tags. |


Expand Down Expand Up @@ -636,13 +638,13 @@ module workspaces './Microsoft.MachineLearningServices/workspaces/deploy.bicep'

```bicep
module workspaces './Microsoft.MachineLearningServices/workspaces/deploy.bicep' = {
name: '${uniqueString(deployment().name)}-test-mlswencr'
name: '${uniqueString(deployment().name)}-test-mlswecr'
params: {
// Required parameters
associatedApplicationInsightsResourceId: '<associatedApplicationInsightsResourceId>'
associatedKeyVaultResourceId: '<associatedKeyVaultResourceId>'
associatedStorageAccountResourceId: '<associatedStorageAccountResourceId>'
name: '<<namePrefix>>mlswencr001'
name: '<<namePrefix>>mlswecr001'
sku: 'Basic'
// Non-required parameters
cMKKeyName: '<cMKKeyName>'
Expand Down Expand Up @@ -691,7 +693,7 @@ module workspaces './Microsoft.MachineLearningServices/workspaces/deploy.bicep'
"value": "<associatedStorageAccountResourceId>"
},
"name": {
"value": "<<namePrefix>>mlswencr001"
"value": "<<namePrefix>>mlswecr001"
},
"sku": {
"value": "Basic"
Expand Down