22param solutionName string
33param solutionLocation string
44param keyVaultName string
5- param deploymentType string
5+ param deploymentType string
66param gptModelName string
77param azureOpenaiAPIVersion string
88param gptDeploymentCapacity int
99param embeddingModel string
10- param embeddingDeploymentCapacity int
10+ param embeddingDeploymentCapacity int
1111param managedIdentityObjectId string
1212
1313// Load the abbrevations file required to name the azure resources.
@@ -85,7 +85,6 @@ resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2023-09-01' = {
8585// }
8686// }
8787
88-
8988resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = {
9089 name : applicationInsightsName
9190 location : location
@@ -98,7 +97,6 @@ resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = {
9897 }
9998}
10099
101-
102100resource containerRegistry 'Microsoft.ContainerRegistry/registries@2021-09-01' = {
103101 name : containerRegistryNameCleaned
104102 location : location
@@ -130,10 +128,9 @@ resource containerRegistry 'Microsoft.ContainerRegistry/registries@2021-09-01' =
130128 }
131129}
132130
133-
134131var storageNameCleaned = replace (storageName , '-' , '' )
135132
136- resource aiServices 'Microsoft.CognitiveServices/accounts@2021-10 -01' = {
133+ resource aiServices 'Microsoft.CognitiveServices/accounts@2024-04 -01-preview ' = {
137134 name : aiServicesName
138135 location : location
139136 sku : {
@@ -149,49 +146,65 @@ resource aiServices 'Microsoft.CognitiveServices/accounts@2021-10-01' = {
149146 }
150147}
151148
152-
149+ // resource aiServices 'Microsoft.CognitiveServices/accounts@2021-10-01' = {
150+ // name: aiServicesName
151+ // location: location
152+ // sku: {
153+ // name: 'S0'
154+ // }
155+ // kind: 'AIServices'
156+ // properties: {
157+ // customSubDomainName: aiServicesName
158+ // // apiProperties: {
159+ // // statisticsEnabled: false
160+ // // }
161+ // publicNetworkAccess: 'Enabled'
162+ // }
163+ // }
153164
154165@batchSize (1 )
155- resource aiServicesDeployments 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01' = [for aiModeldeployment in aiModelDeployments : {
156- parent : aiServices //aiServices_m
157- name : aiModeldeployment .name
158- properties : {
159- model : {
160- format : 'OpenAI'
161- name : aiModeldeployment .model
166+ resource aiServicesDeployments 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01' = [
167+ for aiModeldeployment in aiModelDeployments : {
168+ parent : aiServices //aiServices_m
169+ name : aiModeldeployment .name
170+ properties : {
171+ model : {
172+ format : 'OpenAI'
173+ name : aiModeldeployment .model
174+ }
175+ raiPolicyName : aiModeldeployment .raiPolicyName
176+ }
177+ sku : {
178+ name : aiModeldeployment .sku .name
179+ capacity : aiModeldeployment .sku .capacity
162180 }
163- raiPolicyName : aiModeldeployment .raiPolicyName
164- }
165- sku :{
166- name : aiModeldeployment .sku .name
167- capacity : aiModeldeployment .sku .capacity
168181 }
169- } ]
182+ ]
170183
171184resource aiSearch 'Microsoft.Search/searchServices@2023-11-01' = {
172- name : aiSearchName
173- location : solutionLocation
174- sku : {
175- name : 'basic'
185+ name : aiSearchName
186+ location : solutionLocation
187+ sku : {
188+ name : 'basic'
189+ }
190+ properties : {
191+ replicaCount : 1
192+ partitionCount : 1
193+ hostingMode : 'default'
194+ publicNetworkAccess : 'enabled'
195+ networkRuleSet : {
196+ ipRules : []
176197 }
177- properties : {
178- replicaCount : 1
179- partitionCount : 1
180- hostingMode : 'default'
181- publicNetworkAccess : 'enabled'
182- networkRuleSet : {
183- ipRules : []
184- }
185- encryptionWithCmk : {
186- enforcement : 'Unspecified'
187- }
188- disableLocalAuth : false
189- authOptions : {
190- apiKeyOnly : {}
191- }
192- semanticSearch : 'free'
198+ encryptionWithCmk : {
199+ enforcement : 'Unspecified'
200+ }
201+ disableLocalAuth : false
202+ authOptions : {
203+ apiKeyOnly : {}
193204 }
205+ semanticSearch : 'free'
194206 }
207+ }
195208
196209resource storage 'Microsoft.Storage/storageAccounts@2022-09-01' = {
197210 name : storageNameCleaned
@@ -242,7 +255,6 @@ resource storage 'Microsoft.Storage/storageAccounts@2022-09-01' = {
242255 }
243256}
244257
245-
246258@description ('This is the built-in Storage Blob Data Contributor.' )
247259resource blobDataContributor 'Microsoft.Authorization/roleDefinitions@2018-01-01-preview' existing = {
248260 scope : resourceGroup ()
@@ -253,8 +265,8 @@ resource storageroleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-
253265 name : guid (resourceGroup ().id , managedIdentityObjectId , blobDataContributor .id )
254266 properties : {
255267 principalId : managedIdentityObjectId
256- roleDefinitionId :blobDataContributor .id
257- principalType : 'ServicePrincipal'
268+ roleDefinitionId : blobDataContributor .id
269+ principalType : 'ServicePrincipal'
258270 }
259271}
260272
@@ -293,10 +305,11 @@ resource aiHub 'Microsoft.MachineLearningServices/workspaces@2023-08-01-preview'
293305 }
294306 }
295307 dependsOn : [
296- aiServicesDeployments ,aiSearch
308+ aiServicesDeployments
309+ aiSearch
297310 ]
298311 }
299-
312+
300313 resource aiSearchConnection 'connections@2024-07-01-preview' = {
301314 name : '${aiHubName }-connection-AzureAISearch'
302315 properties : {
@@ -308,16 +321,17 @@ resource aiHub 'Microsoft.MachineLearningServices/workspaces@2023-08-01-preview'
308321 key : aiSearch .listAdminKeys ().primaryKey
309322 }
310323 metadata : {
311- type :'azure_ai_search'
324+ type : 'azure_ai_search'
312325 ApiType : 'Azure'
313326 ResourceId : aiSearch .id
314- ApiVersion :'2024-05-01-preview'
315- DeploymentApiVersion :'2023-11-01'
327+ ApiVersion : '2024-05-01-preview'
328+ DeploymentApiVersion : '2023-11-01'
316329 }
317330 }
318331 }
319332 dependsOn : [
320- aiServicesDeployments ,aiSearch
333+ aiServicesDeployments
334+ aiSearch
321335 ]
322336}
323337
@@ -334,7 +348,6 @@ resource aiHubProject 'Microsoft.MachineLearningServices/workspaces@2024-01-01-p
334348 }
335349}
336350
337-
338351resource tenantIdEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
339352 parent : keyVault
340353 name : 'TENANT-ID'
@@ -343,7 +356,6 @@ resource tenantIdEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' =
343356 }
344357}
345358
346-
347359resource azureOpenAIApiKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
348360 parent : keyVault
349361 name : 'AZURE-OPENAI-KEY'
@@ -364,7 +376,7 @@ resource azureOpenAIApiVersionEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-0
364376 parent : keyVault
365377 name : 'AZURE-OPENAI-PREVIEW-API-VERSION'
366378 properties : {
367- value : azureOpenaiAPIVersion //'2024-07-18'
379+ value : azureOpenaiAPIVersion //'2024-07-18'
368380 }
369381}
370382
@@ -384,7 +396,6 @@ resource azureAIProjectConnectionStringEntry 'Microsoft.KeyVault/vaults/secrets@
384396 }
385397}
386398
387-
388399resource azureSearchAdminKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
389400 parent : keyVault
390401 name : 'AZURE-SEARCH-KEY'
0 commit comments