Skip to content

Commit 75b61d4

Browse files
committed
removed project, resource lock, custom managed key.
1 parent 198a409 commit 75b61d4

1 file changed

Lines changed: 1 addition & 81 deletions

File tree

infra/modules/ai-foundry/ai-services.bicep

Lines changed: 1 addition & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,6 @@ param kind string = 'AIServices'
5757
])
5858
param sku string = 'S0'
5959

60-
@description('Required. The name of the AI Foundry project to create.')
61-
param projectName string
62-
63-
@description('Required. The description of the AI Foundry project to create.')
64-
param projectDescription string = projectName
65-
6660
@description('Optional. Location for all Resources.')
6761
param location string = resourceGroup().location
6862

@@ -90,10 +84,6 @@ import { privateEndpointSingleServiceType } from 'br/public:avm/utl/types/avm-co
9084
@description('Optional. Configuration details for private endpoints. For security reasons, it is recommended to use private endpoints whenever possible.')
9185
param privateEndpoints privateEndpointSingleServiceType[]?
9286

93-
import { lockType } from 'br/public:avm/utl/types/avm-common-types:0.5.1'
94-
@description('Optional. The lock settings of the service.')
95-
param lock lockType?
96-
9787
import { roleAssignmentType } from 'br/public:avm/utl/types/avm-common-types:0.5.1'
9888
@description('Optional. Array of role assignments to create.')
9989
param roleAssignments roleAssignmentType[]?
@@ -110,10 +100,6 @@ param apiProperties object?
110100
@description('Optional. Allow only Azure AD authentication. Should be enabled for security reasons.')
111101
param disableLocalAuth bool = true
112102

113-
import { customerManagedKeyType } from 'br/public:avm/utl/types/avm-common-types:0.5.1'
114-
@description('Optional. The customer managed key definition.')
115-
param customerManagedKey customerManagedKeyType?
116-
117103
@description('Optional. The flag to enable dynamic throttling.')
118104
param dynamicThrottlingEnabled bool = false
119105

@@ -274,26 +260,6 @@ var formattedRoleAssignments = [
274260
})
275261
]
276262

277-
resource cMKKeyVault 'Microsoft.KeyVault/vaults@2024-11-01' existing = if (!empty(customerManagedKey.?keyVaultResourceId)) {
278-
name: last(split(customerManagedKey.?keyVaultResourceId!, '/'))
279-
scope: resourceGroup(
280-
split(customerManagedKey.?keyVaultResourceId!, '/')[2],
281-
split(customerManagedKey.?keyVaultResourceId!, '/')[4]
282-
)
283-
284-
resource cMKKey 'keys@2024-11-01' existing = if (!empty(customerManagedKey.?keyVaultResourceId) && !empty(customerManagedKey.?keyName)) {
285-
name: customerManagedKey.?keyName!
286-
}
287-
}
288-
289-
resource cMKUserAssignedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2024-11-30' existing = if (!empty(customerManagedKey.?userAssignedIdentityResourceId)) {
290-
name: last(split(customerManagedKey.?userAssignedIdentityResourceId!, '/'))
291-
scope: resourceGroup(
292-
split(customerManagedKey.?userAssignedIdentityResourceId!, '/')[2],
293-
split(customerManagedKey.?userAssignedIdentityResourceId!, '/')[4]
294-
)
295-
}
296-
297263
resource cognitiveService 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' = {
298264
name: name
299265
kind: kind
@@ -330,21 +296,7 @@ resource cognitiveService 'Microsoft.CognitiveServices/accounts@2025-04-01-previ
330296
]
331297
: null
332298
// true is not supported today
333-
encryption: !empty(customerManagedKey)
334-
? {
335-
keySource: 'Microsoft.KeyVault'
336-
keyVaultProperties: {
337-
identityClientId: !empty(customerManagedKey.?userAssignedIdentityResourceId ?? '')
338-
? cMKUserAssignedIdentity.properties.clientId
339-
: null
340-
keyVaultUri: cMKKeyVault.properties.vaultUri
341-
keyName: customerManagedKey!.keyName
342-
keyVersion: !empty(customerManagedKey.?keyVersion ?? '')
343-
? customerManagedKey!.?keyVersion
344-
: last(split(cMKKeyVault::cMKKey.properties.keyUriWithVersion, '/'))
345-
}
346-
}
347-
: null
299+
encryption: null // Customer managed key encryption is used, but the property is required.
348300
migrationToken: migrationToken
349301
restore: restore
350302
restrictOutboundNetworkAccess: restrictOutboundNetworkAccess
@@ -373,31 +325,6 @@ resource cognitiveService_deployments 'Microsoft.CognitiveServices/accounts/depl
373325
}
374326
]
375327

376-
resource aiFoundryProject 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' = {
377-
parent: cognitiveService
378-
name: projectName
379-
tags: tags
380-
location: location
381-
identity: {
382-
type: 'SystemAssigned'
383-
}
384-
properties: {
385-
description: projectDescription
386-
displayName: projectName
387-
}
388-
}
389-
390-
resource cognitiveService_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!empty(lock ?? {}) && lock.?kind != 'None') {
391-
name: lock.?name ?? 'lock-${name}'
392-
properties: {
393-
level: lock.?kind ?? ''
394-
notes: lock.?kind == 'CanNotDelete'
395-
? 'Cannot delete resource or child resources.'
396-
: 'Cannot delete or modify the resource or child resources.'
397-
}
398-
scope: cognitiveService
399-
}
400-
401328
#disable-next-line use-recent-api-versions
402329
resource cognitiveService_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = [
403330
for (diagnosticSetting, index) in (diagnosticSettings ?? []): {
@@ -471,7 +398,6 @@ module cognitiveService_privateEndpoints 'br/public:avm/res/network/private-endp
471398
'2020-06-01',
472399
'Full'
473400
).location
474-
lock: privateEndpoint.?lock ?? lock
475401
privateDnsZoneGroup: privateEndpoint.?privateDnsZoneGroup
476402
roleAssignments: privateEndpoint.?roleAssignments
477403
tags: privateEndpoint.?tags ?? tags
@@ -505,12 +431,6 @@ output name string = cognitiveService.name
505431
@description('The resource ID of the cognitive services account.')
506432
output resourceId string = cognitiveService.id
507433

508-
@description('The resource ID of AI project.')
509-
output aiProjectResourceId string = aiFoundryProject.id
510-
511-
@description('The endpoint to connect to the AI Project API')
512-
output aiProjectApiEndpoint string = aiFoundryProject.properties.endpoints['AI Foundry API']
513-
514434
@description('The resource group the cognitive services account was deployed into.')
515435
output resourceGroupName string = resourceGroup().name
516436

0 commit comments

Comments
 (0)