@@ -41,6 +41,9 @@ param existingLogAnalyticsWorkspaceId string = ''
4141@description ('Azure Existing AI Project ResourceID.' )
4242param azureExistingAIProjectResourceId string = ''
4343
44+ @description ('Optional. Tags to be applied to the resources.' )
45+ param tags object = {}
46+
4447//var abbrs = loadJsonContent('./abbreviations.json')
4548
4649var aiFoundryName = 'aif-${solutionName }'
@@ -119,13 +122,13 @@ resource existingLogAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces
119122resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2023-09-01' = if (!useExisting ) {
120123 name : workspaceName
121124 location : location
122- tags : {}
123125 properties : {
124126 retentionInDays : 30
125127 sku : {
126128 name : 'PerGB2018'
127129 }
128130 }
131+ tags : tags
129132}
130133
131134resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = {
@@ -138,6 +141,7 @@ resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = {
138141 publicNetworkAccessForQuery : 'Enabled'
139142 WorkspaceResourceId : useExisting ? existingLogAnalyticsWorkspace .id : logAnalytics .id
140143 }
144+ tags : tags
141145}
142146
143147resource existingAiFoundry 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' existing = if (!empty (azureExistingAIProjectResourceId )) {
@@ -166,6 +170,7 @@ resource aiFoundry 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' = i
166170 publicNetworkAccess : 'Enabled'
167171 disableLocalAuth : false
168172 }
173+ tags : tags
169174}
170175
171176resource aiFoundryProject 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' = if (empty (azureExistingAIProjectResourceId )) {
@@ -179,6 +184,7 @@ resource aiFoundryProject 'Microsoft.CognitiveServices/accounts/projects@2025-04
179184 description : aiProjectDescription
180185 displayName : aiProjectFriendlyName
181186 }
187+ tags : tags
182188}
183189
184190@batchSize (1 )
@@ -197,6 +203,7 @@ resource aiFModelDeployments 'Microsoft.CognitiveServices/accounts/deployments@2
197203 name : aiModeldeployment .sku .name
198204 capacity : aiModeldeployment .sku .capacity
199205 }
206+ tags : tags
200207 }
201208]
202209
@@ -223,6 +230,7 @@ resource aiSearch 'Microsoft.Search/searchServices@2024-06-01-preview' = {
223230 disableLocalAuth : true
224231 semanticSearch : 'free'
225232 }
233+ tags : tags
226234}
227235
228236resource aiSearchFoundryConnection 'Microsoft.CognitiveServices/accounts/projects/connections@2025-04-01-preview' = if (empty (azureExistingAIProjectResourceId )) {
@@ -251,6 +259,7 @@ module existing_AIProject_SearchConnectionModule 'deploy_aifp_aisearch_connectio
251259 aiSearchResourceId : aiSearch .id
252260 aiSearchLocation : aiSearch .location
253261 aiSearchConnectionName : aiSearchConnectionName
262+ tags : tags
254263 }
255264}
256265
@@ -268,6 +277,7 @@ module assignOpenAIRoleToAISearch 'deploy_foundry_role_assignment.bicep' = {
268277 aiProjectName : !empty (azureExistingAIProjectResourceId ) ? existingAIProjectName : aiProjectName
269278 principalId : aiSearch .identity .principalId
270279 aiModelDeployments : aiModelDeployments
280+ tags : tags
271281 }
272282}
273283
@@ -329,6 +339,7 @@ resource tenantIdEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' =
329339 properties : {
330340 value : subscription ().tenantId
331341 }
342+ tags : tags
332343}
333344
334345
@@ -338,6 +349,7 @@ resource azureOpenAIDeploymentModel 'Microsoft.KeyVault/vaults/secrets@2021-11-0
338349 properties : {
339350 value : gptModelName
340351 }
352+ tags : tags
341353}
342354
343355resource azureOpenAIApiVersionEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
@@ -346,6 +358,7 @@ resource azureOpenAIApiVersionEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-0
346358 properties : {
347359 value : azureOpenaiAPIVersion //'2024-02-15-preview'
348360 }
361+ tags : tags
349362}
350363
351364resource azureOpenAIEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
@@ -356,6 +369,7 @@ resource azureOpenAIEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-
356369 ? existingOpenAIEndpoint
357370 : aiFoundry .properties .endpoints ['OpenAI Language Model Instance API' ]
358371 }
372+ tags : tags
359373 }
360374
361375resource azureOpenAIEmbeddingDeploymentModel 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
@@ -364,6 +378,7 @@ resource azureOpenAIEmbeddingDeploymentModel 'Microsoft.KeyVault/vaults/secrets@
364378 properties : {
365379 value : embeddingModel
366380 }
381+ tags : tags
367382}
368383
369384resource azureSearchServiceEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
@@ -372,6 +387,7 @@ resource azureSearchServiceEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021
372387 properties : {
373388 value : 'https://${aiSearch .name }.search.windows.net'
374389 }
390+ tags : tags
375391}
376392
377393resource azureSearchServiceEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
@@ -380,6 +396,7 @@ resource azureSearchServiceEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-p
380396 properties : {
381397 value : aiSearch .name
382398 }
399+ tags : tags
383400}
384401
385402resource azureSearchIndexEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
@@ -388,6 +405,7 @@ resource azureSearchIndexEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-pre
388405 properties : {
389406 value : 'pdf_index'
390407 }
408+ tags : tags
391409}
392410
393411resource cogServiceEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
@@ -398,6 +416,7 @@ resource cogServiceEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-p
398416 ? existingOpenAIEndpoint
399417 : aiFoundry .properties .endpoint
400418 }
419+ tags : tags
401420}
402421
403422resource cogServiceKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
@@ -408,6 +427,7 @@ resource cogServiceKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-previe
408427 ? existingAiFoundry .listKeys ().key1
409428 : aiFoundry .listKeys ().key1
410429 }
430+ tags : tags
411431}
412432
413433resource cogServiceNameEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
@@ -416,6 +436,7 @@ resource cogServiceNameEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-previ
416436 properties : {
417437 value : !empty (existingAIFoundryName ) ? existingAIFoundryName : aiFoundryName
418438 }
439+ tags : tags
419440}
420441
421442resource azureSubscriptionIdEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
@@ -424,6 +445,7 @@ resource azureSubscriptionIdEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-
424445 properties : {
425446 value : subscription ().subscriptionId
426447 }
448+ tags : tags
427449}
428450
429451resource resourceGroupNameEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
@@ -432,6 +454,7 @@ resource resourceGroupNameEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-pr
432454 properties : {
433455 value : resourceGroup ().name
434456 }
457+ tags : tags
435458}
436459
437460resource azureLocatioEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
@@ -440,6 +463,7 @@ resource azureLocatioEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview
440463 properties : {
441464 value : solutionLocation
442465 }
466+ tags : tags
443467}
444468
445469@description ('Contains Name of KeyVault.' )
0 commit comments