Skip to content

Commit d224d34

Browse files
main json file added
1 parent f218f2c commit d224d34

File tree

1 file changed

+212
-8
lines changed

1 file changed

+212
-8
lines changed

infra/main.json

Lines changed: 212 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "0.37.4.10188",
9-
"templateHash": "5746734565036197616"
9+
"templateHash": "15105557945473357848"
1010
},
1111
"name": "Document Generation Solution Accelerator",
1212
"description": "CSA CTO Gold Standard Solution Accelerator for Document Generation.\n"
@@ -251,7 +251,7 @@
251251
},
252252
"createdBy": {
253253
"type": "string",
254-
"defaultValue": "[if(empty(deployer().userPrincipalName), '', split(deployer().userPrincipalName, '@')[0])]",
254+
"defaultValue": "[if(contains(deployer(), 'userPrincipalName'), split(deployer().userPrincipalName, '@')[0], deployer().objectId)]",
255255
"metadata": {
256256
"description": "Optional created by user name"
257257
}
@@ -355,6 +355,7 @@
355355
"appService": 7,
356356
"searchService": 8
357357
},
358+
"shouldCreatePrivateEndpoint": "[and(variables('useExistingAiFoundryAiProject'), parameters('enablePrivateNetworking'))]",
358359
"nenablePrivateNetworking": false,
359360
"storageAccountName": "[format('st{0}', variables('solutionSuffix'))]",
360361
"cosmosDBResourceName": "[format('cosmos-{0}', variables('solutionSuffix'))]",
@@ -394,7 +395,7 @@
394395
"apiVersion": "2021-04-01",
395396
"name": "default",
396397
"properties": {
397-
"tags": "[shallowMerge(createArray(parameters('tags'), createObject('TemplateName', 'Docgen', 'CreatedBy', parameters('createdBy'))))]"
398+
"tags": "[shallowMerge(createArray(parameters('tags'), createObject('TemplateName', 'DocGen', 'Type', if(parameters('enablePrivateNetworking'), 'WAF', 'Non-WAF'), 'CreatedBy', parameters('createdBy'))))]"
398399
}
399400
},
400401
"existingAiFoundryAiServices": {
@@ -24066,6 +24067,210 @@
2406624067
"userAssignedIdentity"
2406724068
]
2406824069
},
24070+
"existingAiServicesPrivateEndpoint": {
24071+
"condition": "[variables('shouldCreatePrivateEndpoint')]",
24072+
"type": "Microsoft.Resources/deployments",
24073+
"apiVersion": "2022-09-01",
24074+
"name": "[take(format('module.private-endpoint.{0}', variables('aiFoundryAiServicesResourceName')), 64)]",
24075+
"properties": {
24076+
"expressionEvaluationOptions": {
24077+
"scope": "inner"
24078+
},
24079+
"mode": "Incremental",
24080+
"parameters": {
24081+
"name": {
24082+
"value": "[format('pep-{0}', variables('aiFoundryAiServicesResourceName'))]"
24083+
},
24084+
"location": {
24085+
"value": "[parameters('location')]"
24086+
},
24087+
"subnetResourceId": {
24088+
"value": "[reference('network').outputs.subnetPrivateEndpointsResourceId.value]"
24089+
},
24090+
"targetResourceId": {
24091+
"value": "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', variables('aiFoundryAiServicesSubscriptionId'), variables('aiFoundryAiServicesResourceGroupName')), 'Microsoft.CognitiveServices/accounts', variables('aiFoundryAiServicesResourceName'))]"
24092+
},
24093+
"groupIds": {
24094+
"value": [
24095+
"account"
24096+
]
24097+
},
24098+
"customNetworkInterfaceName": {
24099+
"value": "[format('nic-{0}', variables('aiFoundryAiServicesResourceName'))]"
24100+
},
24101+
"tags": {
24102+
"value": "[parameters('tags')]"
24103+
},
24104+
"privateDnsZoneGroupConfigs": {
24105+
"value": [
24106+
{
24107+
"name": "ai-services-dns-zone-cognitiveservices",
24108+
"privateDnsZoneResourceId": "[createObject('cognitiveServices', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)).outputs.resourceId.value, 'openAI', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)).outputs.resourceId.value, 'aiServices', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)).outputs.resourceId.value).cognitiveServices]"
24109+
},
24110+
{
24111+
"name": "ai-services-dns-zone-openai",
24112+
"privateDnsZoneResourceId": "[createObject('cognitiveServices', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)).outputs.resourceId.value, 'openAI', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)).outputs.resourceId.value, 'aiServices', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)).outputs.resourceId.value).openAI]"
24113+
},
24114+
{
24115+
"name": "ai-services-dns-zone-aiservices",
24116+
"privateDnsZoneResourceId": "[createObject('cognitiveServices', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)).outputs.resourceId.value, 'openAI', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)).outputs.resourceId.value, 'aiServices', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)).outputs.resourceId.value).aiServices]"
24117+
}
24118+
]
24119+
}
24120+
},
24121+
"template": {
24122+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
24123+
"contentVersion": "1.0.0.0",
24124+
"metadata": {
24125+
"_generator": {
24126+
"name": "bicep",
24127+
"version": "0.37.4.10188",
24128+
"templateHash": "3113830059289382546"
24129+
}
24130+
},
24131+
"parameters": {
24132+
"name": {
24133+
"type": "string",
24134+
"metadata": {
24135+
"description": "Name of the private endpoint"
24136+
}
24137+
},
24138+
"location": {
24139+
"type": "string",
24140+
"defaultValue": "[resourceGroup().location]",
24141+
"metadata": {
24142+
"description": "Location for the private endpoint"
24143+
}
24144+
},
24145+
"subnetResourceId": {
24146+
"type": "string",
24147+
"metadata": {
24148+
"description": "Subnet resource ID where the private endpoint will be created"
24149+
}
24150+
},
24151+
"targetResourceId": {
24152+
"type": "string",
24153+
"metadata": {
24154+
"description": "Resource ID of the target resource for the private endpoint"
24155+
}
24156+
},
24157+
"groupIds": {
24158+
"type": "array",
24159+
"defaultValue": [
24160+
"account"
24161+
],
24162+
"metadata": {
24163+
"description": "Group IDs for the private endpoint connection"
24164+
}
24165+
},
24166+
"customNetworkInterfaceName": {
24167+
"type": "string",
24168+
"defaultValue": "",
24169+
"metadata": {
24170+
"description": "Custom network interface name for the private endpoint"
24171+
}
24172+
},
24173+
"privateDnsZoneGroupConfigs": {
24174+
"type": "array",
24175+
"defaultValue": [],
24176+
"metadata": {
24177+
"description": "Private DNS zone group configurations"
24178+
}
24179+
},
24180+
"tags": {
24181+
"type": "object",
24182+
"defaultValue": {},
24183+
"metadata": {
24184+
"description": "Tags to apply to the private endpoint"
24185+
}
24186+
}
24187+
},
24188+
"resources": [
24189+
{
24190+
"type": "Microsoft.Network/privateEndpoints",
24191+
"apiVersion": "2024-05-01",
24192+
"name": "[parameters('name')]",
24193+
"location": "[parameters('location')]",
24194+
"tags": "[parameters('tags')]",
24195+
"properties": {
24196+
"subnet": {
24197+
"id": "[parameters('subnetResourceId')]"
24198+
},
24199+
"privateLinkServiceConnections": [
24200+
{
24201+
"name": "[parameters('name')]",
24202+
"properties": {
24203+
"privateLinkServiceId": "[parameters('targetResourceId')]",
24204+
"groupIds": "[parameters('groupIds')]"
24205+
}
24206+
}
24207+
],
24208+
"customNetworkInterfaceName": "[if(not(empty(parameters('customNetworkInterfaceName'))), parameters('customNetworkInterfaceName'), null())]"
24209+
}
24210+
},
24211+
{
24212+
"condition": "[not(empty(parameters('privateDnsZoneGroupConfigs')))]",
24213+
"type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups",
24214+
"apiVersion": "2024-05-01",
24215+
"name": "[format('{0}/{1}', parameters('name'), 'default')]",
24216+
"properties": {
24217+
"copy": [
24218+
{
24219+
"name": "privateDnsZoneConfigs",
24220+
"count": "[length(parameters('privateDnsZoneGroupConfigs'))]",
24221+
"input": {
24222+
"name": "[parameters('privateDnsZoneGroupConfigs')[copyIndex('privateDnsZoneConfigs')].name]",
24223+
"properties": {
24224+
"privateDnsZoneId": "[parameters('privateDnsZoneGroupConfigs')[copyIndex('privateDnsZoneConfigs')].privateDnsZoneResourceId]"
24225+
}
24226+
}
24227+
}
24228+
]
24229+
},
24230+
"dependsOn": [
24231+
"[resourceId('Microsoft.Network/privateEndpoints', parameters('name'))]"
24232+
]
24233+
}
24234+
],
24235+
"outputs": {
24236+
"resourceId": {
24237+
"type": "string",
24238+
"metadata": {
24239+
"description": "Resource ID of the private endpoint"
24240+
},
24241+
"value": "[resourceId('Microsoft.Network/privateEndpoints', parameters('name'))]"
24242+
},
24243+
"name": {
24244+
"type": "string",
24245+
"metadata": {
24246+
"description": "Name of the private endpoint"
24247+
},
24248+
"value": "[parameters('name')]"
24249+
},
24250+
"location": {
24251+
"type": "string",
24252+
"metadata": {
24253+
"description": "Location of the private endpoint"
24254+
},
24255+
"value": "[reference(resourceId('Microsoft.Network/privateEndpoints', parameters('name')), '2024-05-01', 'full').location]"
24256+
},
24257+
"networkInterfaceResourceIds": {
24258+
"type": "array",
24259+
"metadata": {
24260+
"description": "Network interface resource IDs associated with the private endpoint"
24261+
},
24262+
"value": "[reference(resourceId('Microsoft.Network/privateEndpoints', parameters('name')), '2024-05-01').networkInterfaces]"
24263+
}
24264+
}
24265+
}
24266+
},
24267+
"dependsOn": [
24268+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)]",
24269+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)]",
24270+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)]",
24271+
"network"
24272+
]
24273+
},
2406924274
"aiFoundryAiServices": {
2407024275
"condition": "[not(variables('useExistingAiFoundryAiProject'))]",
2407124276
"type": "Microsoft.Resources/deployments",
@@ -26682,9 +26887,9 @@
2668226887
}
2668326888
},
2668426889
"dependsOn": [
26890+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)]",
2668526891
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)]",
2668626892
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)]",
26687-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)]",
2668826893
"logAnalyticsWorkspace",
2668926894
"network",
2669026895
"userAssignedIdentity"
@@ -35157,8 +35362,8 @@
3515735362
}
3515835363
},
3515935364
"dependsOn": [
35160-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageQueue)]",
3516135365
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageBlob)]",
35366+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageQueue)]",
3516235367
"network",
3516335368
"userAssignedIdentity"
3516435369
]
@@ -42891,7 +43096,7 @@
4289143096
}
4289243097
},
4289343098
"configs": {
42894-
"value": "[concat(createArray(createObject('name', 'appsettings', 'properties', createObject('SCM_DO_BUILD_DURING_DEPLOYMENT', 'true', 'DOCKER_REGISTRY_SERVER_URL', format('https://{0}.azurecr.io', parameters('acrName')), 'AUTH_ENABLED', 'false', 'AZURE_SEARCH_SERVICE', reference('aiSearch').outputs.name.value, 'AZURE_SEARCH_INDEX', variables('azureSearchIndex'), 'AZURE_SEARCH_USE_SEMANTIC_SEARCH', variables('azureSearchUseSemanticSearch'), 'AZURE_SEARCH_SEMANTIC_SEARCH_CONFIG', variables('azureSearchSemanticSearchConfig'), 'AZURE_SEARCH_INDEX_IS_PRECHUNKED', 'True', 'AZURE_SEARCH_TOP_K', '5', 'AZURE_SEARCH_ENABLE_IN_DOMAIN', variables('azureSearchEnableInDomain'), 'AZURE_SEARCH_CONTENT_COLUMNS', variables('azureSearchContentColumns'), 'AZURE_SEARCH_FILENAME_COLUMN', variables('azureSearchUrlColumn'), 'AZURE_SEARCH_TITLE_COLUMN', '', 'AZURE_SEARCH_URL_COLUMN', '', 'AZURE_SEARCH_QUERY_TYPE', variables('azureSearchQueryType'), 'AZURE_SEARCH_VECTOR_COLUMNS', variables('azureSearchVectorFields'), 'AZURE_SEARCH_PERMITTED_GROUPS_COLUMN', '', 'AZURE_SEARCH_STRICTNESS', '3', 'AZURE_SEARCH_CONNECTION_NAME', variables('aiSearchConnectionName'), 'AZURE_OPENAI_API_VERSION', parameters('azureOpenaiAPIVersion'), 'AZURE_OPENAI_MODEL', parameters('gptModelName'), 'AZURE_OPENAI_ENDPOINT', format('https://{0}.openai.azure.com/', variables('aiFoundryAiServicesResourceName')), 'AZURE_OPENAI_RESOURCE', variables('aiFoundryAiServicesResourceName'), 'AZURE_OPENAI_PREVIEW_API_VERSION', parameters('azureOpenaiAPIVersion'), 'AZURE_OPENAI_GENERATE_SECTION_CONTENT_PROMPT', variables('azureOpenAiGenerateSectionContentPrompt'), 'AZURE_OPENAI_TEMPLATE_SYSTEM_MESSAGE', variables('azureOpenAiTemplateSystemMessage'), 'AZURE_OPENAI_TITLE_PROMPT', variables('azureOpenAiTitlePrompt'), 'AZURE_OPENAI_SYSTEM_MESSAGE', variables('azureOpenAISystemMessage'), 'AZURE_AI_AGENT_ENDPOINT', if(variables('useExistingAiFoundryAiProject'), reference('existingAiFoundryAiServicesProject').endpoints['AI Foundry API'], reference('aiFoundryAiServicesProject').outputs.apiEndpoint.value), 'AZURE_AI_AGENT_MODEL_DEPLOYMENT_NAME', parameters('gptModelName'), 'AZURE_AI_AGENT_API_VERSION', parameters('azureAiAgentApiVersion'), 'SOLUTION_NAME', parameters('solutionName'), 'USE_CHAT_HISTORY_ENABLED', 'True', 'AZURE_COSMOSDB_ACCOUNT', reference('cosmosDB').outputs.name.value, 'AZURE_COSMOSDB_ACCOUNT_KEY', '', 'AZURE_COSMOSDB_CONVERSATIONS_CONTAINER', variables('cosmosDBcollectionName'), 'AZURE_COSMOSDB_DATABASE', variables('cosmosDBDatabaseName'), 'azureCosmosDbEnableFeedback', variables('azureCosmosDbEnableFeedback'), 'UWSGI_PROCESSES', '2', 'UWSGI_THREADS', '2', 'APP_ENV', variables('appEnvironment'), 'AZURE_CLIENT_ID', reference('userAssignedIdentity').outputs.clientId.value), 'applicationInsightResourceId', if(parameters('enableMonitoring'), reference('applicationInsights').outputs.resourceId.value, null()))), if(parameters('enableMonitoring'), createArray(createObject('name', 'logs', 'properties', createObject())), createArray()))]"
43099+
"value": "[concat(createArray(createObject('name', 'appsettings', 'properties', createObject('SCM_DO_BUILD_DURING_DEPLOYMENT', 'true', 'DOCKER_REGISTRY_SERVER_URL', format('https://{0}.azurecr.io', parameters('acrName')), 'AUTH_ENABLED', 'false', 'AZURE_SEARCH_SERVICE', reference('aiSearch').outputs.name.value, 'AZURE_SEARCH_INDEX', variables('azureSearchIndex'), 'AZURE_SEARCH_USE_SEMANTIC_SEARCH', variables('azureSearchUseSemanticSearch'), 'AZURE_SEARCH_SEMANTIC_SEARCH_CONFIG', variables('azureSearchSemanticSearchConfig'), 'AZURE_SEARCH_INDEX_IS_PRECHUNKED', 'True', 'AZURE_SEARCH_TOP_K', '5', 'AZURE_SEARCH_ENABLE_IN_DOMAIN', variables('azureSearchEnableInDomain'), 'AZURE_SEARCH_CONTENT_COLUMNS', variables('azureSearchContentColumns'), 'AZURE_SEARCH_FILENAME_COLUMN', variables('azureSearchUrlColumn'), 'AZURE_SEARCH_TITLE_COLUMN', '', 'AZURE_SEARCH_URL_COLUMN', '', 'AZURE_SEARCH_QUERY_TYPE', variables('azureSearchQueryType'), 'AZURE_SEARCH_VECTOR_COLUMNS', variables('azureSearchVectorFields'), 'AZURE_SEARCH_PERMITTED_GROUPS_COLUMN', '', 'AZURE_SEARCH_STRICTNESS', '3', 'AZURE_SEARCH_CONNECTION_NAME', variables('aiSearchConnectionName'), 'AZURE_OPENAI_API_VERSION', parameters('azureOpenaiAPIVersion'), 'AZURE_OPENAI_MODEL', parameters('gptModelName'), 'AZURE_OPENAI_ENDPOINT', format('https://{0}.openai.azure.com/', variables('aiFoundryAiServicesResourceName')), 'AZURE_OPENAI_RESOURCE', variables('aiFoundryAiServicesResourceName'), 'AZURE_OPENAI_PREVIEW_API_VERSION', parameters('azureOpenaiAPIVersion'), 'AZURE_OPENAI_GENERATE_SECTION_CONTENT_PROMPT', variables('azureOpenAiGenerateSectionContentPrompt'), 'AZURE_OPENAI_TEMPLATE_SYSTEM_MESSAGE', variables('azureOpenAiTemplateSystemMessage'), 'AZURE_OPENAI_TITLE_PROMPT', variables('azureOpenAiTitlePrompt'), 'AZURE_OPENAI_SYSTEM_MESSAGE', variables('azureOpenAISystemMessage'), 'AZURE_AI_AGENT_ENDPOINT', if(variables('useExistingAiFoundryAiProject'), format('https://{0}.services.ai.azure.com/api/projects/{1}', variables('aiFoundryAiServicesResourceName'), variables('aiFoundryAiProjectResourceName')), reference('aiFoundryAiServicesProject').outputs.apiEndpoint.value), 'AZURE_AI_AGENT_MODEL_DEPLOYMENT_NAME', parameters('gptModelName'), 'AZURE_AI_AGENT_API_VERSION', parameters('azureAiAgentApiVersion'), 'SOLUTION_NAME', parameters('solutionName'), 'USE_CHAT_HISTORY_ENABLED', 'True', 'AZURE_COSMOSDB_ACCOUNT', reference('cosmosDB').outputs.name.value, 'AZURE_COSMOSDB_ACCOUNT_KEY', '', 'AZURE_COSMOSDB_CONVERSATIONS_CONTAINER', variables('cosmosDBcollectionName'), 'AZURE_COSMOSDB_DATABASE', variables('cosmosDBDatabaseName'), 'azureCosmosDbEnableFeedback', variables('azureCosmosDbEnableFeedback'), 'UWSGI_PROCESSES', '2', 'UWSGI_THREADS', '2', 'APP_ENV', variables('appEnvironment'), 'AZURE_CLIENT_ID', reference('userAssignedIdentity').outputs.clientId.value), 'applicationInsightResourceId', if(parameters('enableMonitoring'), reference('applicationInsights').outputs.resourceId.value, null()))), if(parameters('enableMonitoring'), createArray(createObject('name', 'logs', 'properties', createObject())), createArray()))]"
4289543100
},
4289643101
"enableMonitoring": {
4289743102
"value": "[parameters('enableMonitoring')]"
@@ -44909,7 +45114,6 @@
4490945114
"aiSearch",
4491045115
"applicationInsights",
4491145116
"cosmosDB",
44912-
"existingAiFoundryAiServicesProject",
4491345117
"logAnalyticsWorkspace",
4491445118
"network",
4491545119
"userAssignedIdentity",
@@ -45098,7 +45302,7 @@
4509845302
"metadata": {
4509945303
"description": "Contains AI Agent Endpoint"
4510045304
},
45101-
"value": "[if(variables('useExistingAiFoundryAiProject'), reference('existingAiFoundryAiServicesProject').endpoints['AI Foundry API'], reference('aiFoundryAiServicesProject').outputs.apiEndpoint.value)]"
45305+
"value": "[if(variables('useExistingAiFoundryAiProject'), format('https://{0}.services.ai.azure.com/api/projects/{1}', variables('aiFoundryAiServicesResourceName'), variables('aiFoundryAiProjectResourceName')), reference('aiFoundryAiServicesProject').outputs.apiEndpoint.value)]"
4510245306
},
4510345307
"AZURE_AI_AGENT_API_VERSION": {
4510445308
"type": "string",

0 commit comments

Comments
 (0)