-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmachine-learning-workspace.bicep
80 lines (74 loc) · 2.85 KB
/
machine-learning-workspace.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import { diagnosticSettingsInfo } from '../management_governance/log-analytics-workspace.bicep'
@description('Name of the resource.')
param name string
@description('Location to deploy the resource. Defaults to the location of the resource group.')
param location string = resourceGroup().location
@description('Tags for the resource.')
param tags object = {}
@description('ID for the Storage Account associated with the ML workspace.')
param storageAccountId string
@description('ID for the Key Vault associated with the ML workspace.')
param keyVaultId string
@description('ID for the Application Insights associated with the ML workspace.')
param applicationInsightsId string
@description('ID for the Container Registry associated with the ML workspace.')
param containerRegistryId string
@description('Whether to reduce telemetry collection and enable additional encryption. Defaults to false.')
param enableHealthBehaviorInsight bool = false
@description('ID for the Managed Identity associated with the ML workspace.')
param identityId string
@description('Name of the Log Analytics Workspace to use for diagnostic settings.')
param logAnalyticsWorkspaceName string?
@description('Diagnostic settings to configure for the ML Workspace instance. Defaults to all logs and metrics.')
param diagnosticSettings diagnosticSettingsInfo = {
logs: [
{
categoryGroup: 'allLogs'
enabled: true
}
]
metrics: [
{
category: 'AllMetrics'
enabled: true
}
]
}
resource mlWorkspace 'Microsoft.MachineLearningServices/workspaces@2024-04-01-preview' = {
name: name
location: location
tags: tags
identity: {
type: 'UserAssigned'
userAssignedIdentities: {
'${identityId}': {}
}
}
properties: {
friendlyName: name
storageAccount: storageAccountId
keyVault: keyVaultId
applicationInsights: applicationInsightsId
containerRegistry: containerRegistryId
hbiWorkspace: enableHealthBehaviorInsight
primaryUserAssignedIdentity: identityId
}
}
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2023-09-01' existing = if (logAnalyticsWorkspaceName != null) {
name: logAnalyticsWorkspaceName!
}
resource mlWorkspaceDiagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if (logAnalyticsWorkspaceName != null) {
name: '${mlWorkspace.name}-diagnostic-settings'
scope: mlWorkspace
properties: {
workspaceId: logAnalyticsWorkspace.id
logs: diagnosticSettings!.logs
metrics: diagnosticSettings!.metrics
}
}
@description('The deployed ML workspace resource.')
output resource resource = mlWorkspace
@description('ID for the deployed ML workspace resource.')
output id string = mlWorkspace.id
@description('Name for the deployed ML workspace resource.')
output name string = mlWorkspace.name