Skip to content

Commit 15357df

Browse files
author
Shreyas-Microsoft
committed
remove commented code
1 parent 47fd2b4 commit 15357df

2 files changed

Lines changed: 14 additions & 131 deletions

File tree

infra/deploy_ai_foundry.bicep

Lines changed: 8 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ param managedIdentityObjectId string
1111
param aiServicesEndpoint string
1212
param aiServicesKey string
1313
param aiServicesId string
14+
param aureaiFoundryEndpoint string
1415

1516
param aiFoundryName string
1617
param existingLogAnalyticsWorkspaceId string = ''
@@ -69,125 +70,6 @@ resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = {
6970

7071
var storageNameCleaned = replace(replace(replace(replace('${storageName}cast', '-', ''), '_', ''), '.', ''),'/', '')
7172

72-
73-
74-
75-
// resource storage 'Microsoft.Storage/storageAccounts@2022-09-01' = {
76-
// name: storageNameCleaned
77-
// location: location
78-
// sku: {
79-
// name: storageSkuName
80-
// }
81-
// kind: 'StorageV2'
82-
// identity: {
83-
// type: 'SystemAssigned'
84-
// }
85-
// properties: {
86-
// accessTier: 'Hot'
87-
// allowBlobPublicAccess: false
88-
// allowCrossTenantReplication: false
89-
// allowSharedKeyAccess: false
90-
// encryption: {
91-
// keySource: 'Microsoft.Storage'
92-
// requireInfrastructureEncryption: false
93-
// services: {
94-
// blob: {
95-
// enabled: true
96-
// keyType: 'Account'
97-
// }
98-
// file: {
99-
// enabled: true
100-
// keyType: 'Account'
101-
// }
102-
// queue: {
103-
// enabled: true
104-
// keyType: 'Service'
105-
// }
106-
// table: {
107-
// enabled: true
108-
// keyType: 'Service'
109-
// }
110-
// }
111-
// }
112-
// isHnsEnabled: false
113-
// isNfsV3Enabled: false
114-
// keyPolicy: {
115-
// keyExpirationPeriodInDays: 7
116-
// }
117-
// largeFileSharesState: 'Disabled'
118-
// minimumTlsVersion: 'TLS1_2'
119-
// networkAcls: {
120-
// bypass: 'AzureServices'
121-
// defaultAction: 'Allow'
122-
// }
123-
// supportsHttpsTrafficOnly: true
124-
// }
125-
// }
126-
127-
// @description('This is the built-in Storage Blob Data Contributor.')
128-
// resource blobDataContributor 'Microsoft.Authorization/roleDefinitions@2018-01-01-preview' existing = {
129-
// scope: subscription()
130-
// name: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe'
131-
// }
132-
133-
// resource storageroleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
134-
// name: guid(resourceGroup().id, managedIdentityObjectId, blobDataContributor.id)
135-
// scope: storage
136-
// properties: {
137-
// principalId: managedIdentityObjectId
138-
// roleDefinitionId: blobDataContributor.id
139-
// principalType: 'ServicePrincipal'
140-
// }
141-
// }
142-
143-
// resource aiHub 'Microsoft.MachineLearningServices/workspaces@2023-08-01-preview' = {
144-
// name: azureAiHubName
145-
// location: location
146-
// identity: {
147-
// type: 'SystemAssigned'
148-
// }
149-
// properties: {
150-
// // organization
151-
// friendlyName: aiHubFriendlyName
152-
// description: aiHubDescription
153-
154-
// // dependent resources
155-
// keyVault: keyVault.id
156-
// storageAccount: storage.id
157-
// }
158-
// kind: 'hub'
159-
160-
// resource aiServicesConnection 'connections@2024-07-01-preview' = {
161-
// name: '${azureAiHubName}-connection-AzureOpenAI'
162-
// properties: {
163-
// category: 'AIServices'
164-
// target: aiServicesEndpoint
165-
// authType: 'ApiKey'
166-
// isSharedToAll: true
167-
// credentials: {
168-
// key: aiServicesKey
169-
// }
170-
// metadata: {
171-
// ApiType: 'Azure'
172-
// ResourceId: aiServicesId
173-
// }
174-
// }
175-
// }
176-
// }
177-
178-
// resource aiHubProject 'Microsoft.MachineLearningServices/workspaces@2024-01-01-preview' = {
179-
// name: aiProjectName
180-
// location: location
181-
// kind: 'Project'
182-
// identity: {
183-
// type: 'SystemAssigned'
184-
// }
185-
// properties: {
186-
// friendlyName: aiProjectFriendlyName
187-
// hubResourceId: aiHub.id
188-
// }
189-
// }
190-
19173
resource tenantIdEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
19274
parent: keyVault
19375
name: 'TENANT-ID'
@@ -244,13 +126,13 @@ resource azureOpenAIEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-
244126
}
245127
}
246128

247-
// resource azureAIProjectConnectionStringEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
248-
// parent: keyVault
249-
// name: 'AZURE-AI-PROJECT-CONN-STRING'
250-
// properties: {
251-
// value: '${split(aiFoundryProject.properties.discoveryUrl, '/')[2]};${subscription().subscriptionId};${resourceGroup().name};${aiFoundryProject.name}'
252-
// }
253-
// }
129+
resource azureAIProjectEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
130+
parent: keyVault
131+
name: 'AI-PROJECT-ENDPOINT'
132+
properties: {
133+
value: aureaiFoundryEndpoint
134+
}
135+
}
254136

255137
resource azureOpenAICUApiVersionEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
256138
parent: keyVault
@@ -324,5 +206,4 @@ output aiSearchName string = aiSearchName
324206
output storageAccountName string = storageNameCleaned
325207

326208
output logAnalyticsId string = useExisting ? existingLogAnalyticsWorkspace.id : logAnalytics.id
327-
// output storageAccountId string = storage.id
328209
output applicationInsightsConnectionString string = applicationInsights.properties.ConnectionString

infra/main.bicep

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ module azureAifoundry 'deploy_ai_foundry.bicep' = {
172172
aiServicesKey: azureAiServices.listKeys().key1
173173
aiServicesId: azureAiServices.id
174174
existingLogAnalyticsWorkspaceId: existingLogAnalyticsWorkspaceId
175+
aureaiFoundryEndpoint: aiFoundryProject.properties.endpoints['AI Foundry API']
175176
}
176177
scope: resourceGroup(resourceGroup().name)
177178
}
@@ -467,6 +468,7 @@ resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
467468
properties: {
468469
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe') // Storage Blob Data Contributor
469470
principalId: containerAppBackend.identity.principalId
471+
principalType: 'ServicePrincipal'
470472
}
471473
}
472474
var openAiContributorRoleId = 'a001fd3d-188f-4b5d-821b-7da978bf7442' // Fixed Role ID for OpenAI Contributor
@@ -477,6 +479,7 @@ resource openAiRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-0
477479
properties: {
478480
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', openAiContributorRoleId) // OpenAI Service Contributor
479481
principalId: containerAppBackend.identity.principalId
482+
principalType: 'ServicePrincipal'
480483
}
481484
}
482485

@@ -493,10 +496,6 @@ resource containers 'Microsoft.Storage/storageAccounts/blobServices/containers@2
493496
dependsOn: [azureAifoundry]
494497
}]
495498

496-
// resource aiHubProject 'Microsoft.MachineLearningServices/workspaces@2024-01-01-preview' existing = {
497-
// name: '${abbrs.ai.aiHubProject}${ResourcePrefix}' // aiProjectName must be calculated - available at main start.
498-
// }
499-
500499
resource aiDeveloper 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
501500
name: '64702f94-c441-49e6-a78b-ef80e0188fee'
502501
}
@@ -507,6 +506,7 @@ resource aiDeveloperAccessProj 'Microsoft.Authorization/roleAssignments@2022-04-
507506
properties: {
508507
roleDefinitionId: aiDeveloper.id
509508
principalId: containerAppBackend.identity.principalId
509+
principalType: 'ServicePrincipal'
510510
}
511511
}
512512

@@ -521,6 +521,7 @@ resource aiUserAccessProj 'Microsoft.Authorization/roleAssignments@2022-04-01' =
521521
properties: {
522522
roleDefinitionId: aiUser.id
523523
principalId: containerAppBackend.identity.principalId
524+
principalType: 'ServicePrincipal'
524525
}
525526
}
526527

@@ -530,6 +531,7 @@ resource aiUserAccessFoundry 'Microsoft.Authorization/roleAssignments@2022-04-01
530531
properties: {
531532
roleDefinitionId: aiUser.id
532533
principalId: containerAppBackend.identity.principalId
534+
principalType: 'ServicePrincipal'
533535
}
534536
}
535537

0 commit comments

Comments
 (0)