Skip to content

Commit 08936f7

Browse files
feat: Updated main.json
1 parent ed61d43 commit 08936f7

File tree

1 file changed

+58
-51
lines changed

1 file changed

+58
-51
lines changed

infra/main.json

Lines changed: 58 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"metadata": {
55
"_generator": {
66
"name": "bicep",
7-
"version": "0.35.1.17967",
8-
"templateHash": "13536585236097147854"
7+
"version": "0.34.44.8038",
8+
"templateHash": "2314751827847241018"
99
}
1010
},
1111
"parameters": {
@@ -89,6 +89,13 @@
8989
"AZURE_LOCATION": {
9090
"type": "string",
9191
"defaultValue": ""
92+
},
93+
"existingLogAnalyticsWorkspaceId": {
94+
"type": "string",
95+
"defaultValue": "",
96+
"metadata": {
97+
"description": "Optional: Existing Log Analytics Workspace Resource ID"
98+
}
9299
}
93100
},
94101
"variables": {
@@ -322,41 +329,9 @@
322329
"abbrs": "[variables('$fxv#0')]",
323330
"solutionLocation": "[if(empty(parameters('AZURE_LOCATION')), resourceGroup().location, parameters('AZURE_LOCATION'))]",
324331
"uniqueId": "[toLower(uniqueString(parameters('environmentName'), subscription().id, variables('solutionLocation')))]",
325-
"solutionPrefix": "[format('dg{0}', padLeft(take(variables('uniqueId'), 12), 12, '0'))]",
326-
"baseUrl": "https://raw.githubusercontent.com/microsoft/document-generation-solution-accelerator/main/",
327-
"ApplicationInsightsName": "[format('{0}{1}', variables('abbrs').managementGovernance.applicationInsights, variables('solutionPrefix'))]",
328-
"WorkspaceName": "[format('{0}{1}', variables('abbrs').managementGovernance.logAnalyticsWorkspace, variables('solutionPrefix'))]"
332+
"solutionPrefix": "[format('dg{0}', padLeft(take(variables('uniqueId'), 12), 12, '0'))]"
329333
},
330334
"resources": [
331-
{
332-
"type": "Microsoft.OperationalInsights/workspaces",
333-
"apiVersion": "2020-08-01",
334-
"name": "[variables('WorkspaceName')]",
335-
"location": "[variables('solutionLocation')]",
336-
"properties": {
337-
"sku": {
338-
"name": "PerGB2018"
339-
},
340-
"retentionInDays": 30
341-
}
342-
},
343-
{
344-
"type": "Microsoft.Insights/components",
345-
"apiVersion": "2020-02-02",
346-
"name": "[variables('ApplicationInsightsName')]",
347-
"location": "[variables('solutionLocation')]",
348-
"tags": {
349-
"[format('hidden-link:{0}', resourceId('Microsoft.Web/sites', variables('ApplicationInsightsName')))]": "Resource"
350-
},
351-
"properties": {
352-
"Application_Type": "web",
353-
"WorkspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', variables('WorkspaceName'))]"
354-
},
355-
"kind": "web",
356-
"dependsOn": [
357-
"[resourceId('Microsoft.OperationalInsights/workspaces', variables('WorkspaceName'))]"
358-
]
359-
},
360335
{
361336
"type": "Microsoft.Resources/deployments",
362337
"apiVersion": "2022-09-01",
@@ -384,8 +359,8 @@
384359
"metadata": {
385360
"_generator": {
386361
"name": "bicep",
387-
"version": "0.35.1.17967",
388-
"templateHash": "14416829741819681429"
362+
"version": "0.34.44.8038",
363+
"templateHash": "17718433303911294858"
389364
}
390365
},
391366
"parameters": {
@@ -479,8 +454,8 @@
479454
"metadata": {
480455
"_generator": {
481456
"name": "bicep",
482-
"version": "0.35.1.17967",
483-
"templateHash": "14711167186840027914"
457+
"version": "0.34.44.8038",
458+
"templateHash": "10936025922757970234"
484459
}
485460
},
486461
"parameters": {
@@ -610,6 +585,9 @@
610585
},
611586
"managedIdentityObjectId": {
612587
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_managed_identity'), '2022-09-01').outputs.managedIdentityOutput.value.objectId]"
588+
},
589+
"existingLogAnalyticsWorkspaceId": {
590+
"value": "[parameters('existingLogAnalyticsWorkspaceId')]"
613591
}
614592
},
615593
"template": {
@@ -618,8 +596,8 @@
618596
"metadata": {
619597
"_generator": {
620598
"name": "bicep",
621-
"version": "0.35.1.17967",
622-
"templateHash": "6302547316976018886"
599+
"version": "0.34.44.8038",
600+
"templateHash": "11696293929000817451"
623601
}
624602
},
625603
"parameters": {
@@ -652,6 +630,10 @@
652630
},
653631
"managedIdentityObjectId": {
654632
"type": "string"
633+
},
634+
"existingLogAnalyticsWorkspaceId": {
635+
"type": "string",
636+
"defaultValue": ""
655637
}
656638
},
657639
"variables": {
@@ -897,6 +879,9 @@
897879
"aiProjectFriendlyName": "[variables('aiProjectName')]",
898880
"aiSearchName": "[format('{0}{1}', variables('abbrs').ai.aiSearch, parameters('solutionName'))]",
899881
"workspaceName": "[format('{0}{1}', variables('abbrs').managementGovernance.logAnalyticsWorkspace, parameters('solutionName'))]",
882+
"useExisting": "[not(empty(parameters('existingLogAnalyticsWorkspaceId')))]",
883+
"existingLawResourceGroup": "[if(variables('useExisting'), split(parameters('existingLogAnalyticsWorkspaceId'), '/')[4], '')]",
884+
"existingLawName": "[if(variables('useExisting'), split(parameters('existingLogAnalyticsWorkspaceId'), '/')[8], '')]",
900885
"aiModelDeployments": [
901886
{
902887
"name": "[parameters('gptModelName')]",
@@ -905,6 +890,7 @@
905890
"name": "[parameters('deploymentType')]",
906891
"capacity": "[parameters('gptDeploymentCapacity')]"
907892
},
893+
"version": "2024-05-13",
908894
"raiPolicyName": "Microsoft.Default"
909895
},
910896
{
@@ -914,6 +900,7 @@
914900
"name": "Standard",
915901
"capacity": "[parameters('embeddingDeploymentCapacity')]"
916902
},
903+
"version": "2",
917904
"raiPolicyName": "Microsoft.Default"
918905
}
919906
],
@@ -971,6 +958,7 @@
971958
]
972959
},
973960
{
961+
"condition": "[not(variables('useExisting'))]",
974962
"type": "Microsoft.OperationalInsights/workspaces",
975963
"apiVersion": "2023-09-01",
976964
"name": "[variables('workspaceName')]",
@@ -993,7 +981,7 @@
993981
"Application_Type": "web",
994982
"publicNetworkAccessForIngestion": "Enabled",
995983
"publicNetworkAccessForQuery": "Enabled",
996-
"WorkspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', variables('workspaceName'))]"
984+
"WorkspaceResourceId": "[if(variables('useExisting'), extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('existingLawResourceGroup')), 'Microsoft.OperationalInsights/workspaces', variables('existingLawName')), resourceId('Microsoft.OperationalInsights/workspaces', variables('workspaceName')))]"
997985
},
998986
"dependsOn": [
999987
"[resourceId('Microsoft.OperationalInsights/workspaces', variables('workspaceName'))]"
@@ -1059,9 +1047,11 @@
10591047
"properties": {
10601048
"model": {
10611049
"format": "OpenAI",
1062-
"name": "[variables('aiModelDeployments')[copyIndex()].model]"
1050+
"name": "[variables('aiModelDeployments')[copyIndex()].model]",
1051+
"version": "[variables('aiModelDeployments')[copyIndex()].version]"
10631052
},
1064-
"raiPolicyName": "[variables('aiModelDeployments')[copyIndex()].raiPolicyName]"
1053+
"raiPolicyName": "[variables('aiModelDeployments')[copyIndex()].raiPolicyName]",
1054+
"versionUpgradeOption": "OnceCurrentVersionExpired"
10651055
},
10661056
"sku": {
10671057
"name": "[variables('aiModelDeployments')[copyIndex()].sku.name]",
@@ -1399,11 +1389,15 @@
13991389
},
14001390
"logAnalyticsWorkspaceResourceName": {
14011391
"type": "string",
1402-
"value": "[variables('workspaceName')]"
1392+
"value": "[if(variables('useExisting'), variables('existingLawName'), variables('workspaceName'))]"
14031393
},
14041394
"storageAccountName": {
14051395
"type": "string",
14061396
"value": "[variables('storageNameCleaned')]"
1397+
},
1398+
"applicationInsightsConnectionString": {
1399+
"type": "string",
1400+
"value": "[reference(resourceId('Microsoft.Insights/components', variables('applicationInsightsName')), '2020-02-02').ConnectionString]"
14071401
}
14081402
}
14091403
}
@@ -1446,8 +1440,8 @@
14461440
"metadata": {
14471441
"_generator": {
14481442
"name": "bicep",
1449-
"version": "0.35.1.17967",
1450-
"templateHash": "12684246002053954621"
1443+
"version": "0.34.44.8038",
1444+
"templateHash": "14155463992250872710"
14511445
}
14521446
},
14531447
"parameters": {
@@ -1667,6 +1661,9 @@
16671661
"AZURE_COSMOSDB_DATABASE": {
16681662
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_cosmos_db'), '2022-09-01').outputs.cosmosDatabaseName.value]"
16691663
},
1664+
"appInsightsConnectionString": {
1665+
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_ai_foundry'), '2022-09-01').outputs.applicationInsightsConnectionString.value]"
1666+
},
16701667
"AZURE_COSMOSDB_ENABLE_FEEDBACK": {
16711668
"value": "True"
16721669
},
@@ -1683,8 +1680,8 @@
16831680
"metadata": {
16841681
"_generator": {
16851682
"name": "bicep",
1686-
"version": "0.35.1.17967",
1687-
"templateHash": "2607460382594511507"
1683+
"version": "0.34.44.8038",
1684+
"templateHash": "18445548436179238004"
16881685
}
16891686
},
16901687
"parameters": {
@@ -1907,6 +1904,12 @@
19071904
},
19081905
"applicationInsightsId": {
19091906
"type": "string"
1907+
},
1908+
"appInsightsConnectionString": {
1909+
"type": "securestring",
1910+
"metadata": {
1911+
"description": "The Application Insights connection string"
1912+
}
19101913
}
19111914
},
19121915
"variables": {
@@ -1971,6 +1974,10 @@
19711974
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
19721975
"value": "[reference(parameters('applicationInsightsId'), '2015-05-01').InstrumentationKey]"
19731976
},
1977+
{
1978+
"name": "APPLICATIONINSIGHTS_CONNECTION_STRING",
1979+
"value": "[parameters('appInsightsConnectionString')]"
1980+
},
19741981
{
19751982
"name": "AZURE_SEARCH_SERVICE",
19761983
"value": "[parameters('aiSearchService')]"
@@ -2176,8 +2183,8 @@
21762183
"metadata": {
21772184
"_generator": {
21782185
"name": "bicep",
2179-
"version": "0.35.1.17967",
2180-
"templateHash": "12799194170352887919"
2186+
"version": "0.34.44.8038",
2187+
"templateHash": "9693594232553540170"
21812188
}
21822189
},
21832190
"parameters": {

0 commit comments

Comments
 (0)