|
5 | 5 | "_generator": { |
6 | 6 | "name": "bicep", |
7 | 7 | "version": "0.33.93.31351", |
8 | | - "templateHash": "17542743656550028202" |
| 8 | + "templateHash": "17465000776634471517" |
9 | 9 | } |
10 | 10 | }, |
11 | 11 | "parameters": { |
|
67 | 67 | } |
68 | 68 | }, |
69 | 69 | "variables": { |
70 | | - "randomSuffix": "[substring(parameters('environmentName'), 3, 10)]", |
| 70 | + "randomSuffix": "[substring(parameters('environmentName'), 0, min(10, length(parameters('environmentName'))))]", |
71 | 71 | "finalName": "[format('{0}-{1}', parameters('ResourcePrefix'), variables('randomSuffix'))]", |
72 | 72 | "backEndVersion": "[if(parameters('Authorization'), 'rcauth', 'rcnoauth')]", |
73 | 73 | "frontEndVersion": "[if(parameters('Authorization'), 'rcauth', 'rcnoauth')]", |
|
86 | 86 | "gptModelVersion": "2024-08-06", |
87 | 87 | "storageNameCleanedContainer": "[replace(variables('storageContainerName'), '-', '')]", |
88 | 88 | "aiServicesName": "[format('{0}-aiservices', variables('prefixCleaned'))]", |
89 | | - "imageName": "[format('cmsacontainerreg.azurecr.io/cmsabackend:{0}', variables('frontEndVersion'))]", |
90 | 89 | "aiModelDeployments": [ |
91 | 90 | { |
92 | 91 | "name": "[variables('llmModel')]", |
|
156 | 155 | "type": "SystemAssigned" |
157 | 156 | }, |
158 | 157 | "properties": { |
159 | | - "managedEnvironmentId": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', toLower(format('{0}conAppsEnv', variables('prefixCleaned')))), '2022-09-01').outputs.resourceId.value]", |
| 158 | + "managedEnvironmentId": "[reference(resourceId('Microsoft.Resources/deployments', toLower(format('{0}conAppsEnv', variables('prefixCleaned')))), '2022-09-01').outputs.resourceId.value]", |
160 | 159 | "configuration": { |
161 | 160 | "ingress": { |
162 | 161 | "external": true, |
|
175 | 174 | "env": [ |
176 | 175 | { |
177 | 176 | "name": "COSMOSDB_ENDPOINT", |
178 | | - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned')))), '2022-09-01').outputs.endpoint.value]" |
| 177 | + "value": "[reference(resourceId('Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned')))), '2022-09-01').outputs.endpoint.value]" |
179 | 178 | }, |
180 | 179 | { |
181 | 180 | "name": "COSMOSDB_DATABASE", |
|
244 | 243 | }, |
245 | 244 | "dependsOn": [ |
246 | 245 | "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_ai_foundry')]", |
247 | | - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', toLower(format('{0}conAppsEnv', variables('prefixCleaned'))))]", |
248 | | - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned'))))]", |
| 246 | + "[resourceId('Microsoft.Resources/deployments', toLower(format('{0}conAppsEnv', variables('prefixCleaned'))))]", |
| 247 | + "[resourceId('Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned'))))]", |
249 | 248 | "[resourceId('Microsoft.Storage/storageAccounts', variables('storageNameCleanedContainer'))]" |
250 | 249 | ] |
251 | 250 | }, |
|
969 | 968 | "type": "Microsoft.Resources/deployments", |
970 | 969 | "apiVersion": "2022-09-01", |
971 | 970 | "name": "[toLower(format('{0}conAppsEnv', variables('prefixCleaned')))]", |
972 | | - "resourceGroup": "[resourceGroup().name]", |
973 | 971 | "properties": { |
974 | 972 | "expressionEvaluationOptions": { |
975 | 973 | "scope": "inner" |
|
1589 | 1587 | "type": "Microsoft.Resources/deployments", |
1590 | 1588 | "apiVersion": "2022-09-01", |
1591 | 1589 | "name": "[toLower(format('{0}database', variables('prefixCleaned')))]", |
1592 | | - "resourceGroup": "[resourceGroup().name]", |
1593 | 1590 | "properties": { |
1594 | 1591 | "expressionEvaluationOptions": { |
1595 | 1592 | "scope": "inner" |
|
5406 | 5403 | "type": "Microsoft.Resources/deployments", |
5407 | 5404 | "apiVersion": "2022-09-01", |
5408 | 5405 | "name": "[toLower(format('{0}containerAppFrontend', variables('prefixCleaned')))]", |
5409 | | - "resourceGroup": "[resourceGroup().name]", |
5410 | 5406 | "properties": { |
5411 | 5407 | "expressionEvaluationOptions": { |
5412 | 5408 | "scope": "inner" |
|
5430 | 5426 | "value": "[format('https://{0}', reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}containerBackend', variables('prefixCleaned')))), '2023-05-01').configuration.ingress.fqdn)]" |
5431 | 5427 | } |
5432 | 5428 | ], |
5433 | | - "image": "[variables('imageName')]", |
| 5429 | + "image": "[format('cmsacontainerreg.azurecr.io/cmsafrontend:{0}', variables('frontEndVersion'))]", |
5434 | 5430 | "name": "cmsafrontend", |
5435 | 5431 | "resources": { |
5436 | 5432 | "cpu": "1", |
|
5452 | 5448 | "value": 1 |
5453 | 5449 | }, |
5454 | 5450 | "environmentResourceId": { |
5455 | | - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', toLower(format('{0}conAppsEnv', variables('prefixCleaned')))), '2022-09-01').outputs.resourceId.value]" |
| 5451 | + "value": "[reference(resourceId('Microsoft.Resources/deployments', toLower(format('{0}conAppsEnv', variables('prefixCleaned')))), '2022-09-01').outputs.resourceId.value]" |
5456 | 5452 | }, |
5457 | 5453 | "name": { |
5458 | 5454 | "value": "[toLower(format('{0}containerFrontend', variables('prefixCleaned')))]" |
|
6628 | 6624 | }, |
6629 | 6625 | "dependsOn": [ |
6630 | 6626 | "[resourceId('Microsoft.App/containerApps', toLower(format('{0}containerBackend', variables('prefixCleaned'))))]", |
6631 | | - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', toLower(format('{0}conAppsEnv', variables('prefixCleaned'))))]", |
| 6627 | + "[resourceId('Microsoft.Resources/deployments', toLower(format('{0}conAppsEnv', variables('prefixCleaned'))))]", |
6632 | 6628 | "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_managed_identity')]" |
6633 | 6629 | ] |
6634 | 6630 | }, |
6635 | 6631 | { |
6636 | 6632 | "type": "Microsoft.Resources/deployments", |
6637 | 6633 | "apiVersion": "2022-09-01", |
6638 | 6634 | "name": "deploymentScriptCLI", |
6639 | | - "resourceGroup": "[resourceGroup().name]", |
6640 | 6635 | "properties": { |
6641 | 6636 | "expressionEvaluationOptions": { |
6642 | 6637 | "scope": "inner" |
|
6663 | 6658 | } |
6664 | 6659 | }, |
6665 | 6660 | "scriptContent": { |
6666 | | - "value": "[format('az cosmosdb sql role assignment create --resource-group \"{0}\" --account-name \"{1}\" --role-definition-id \"{2}\" --scope \"{3}\" --principal-id \"{4}\"', resourceGroup().name, reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned')))), '2022-09-01').outputs.name.value, resourceId('Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', split(format('{0}/00000000-0000-0000-0000-000000000002', toLower(format('{0}database', variables('prefixCleaned')))), '/')[0], split(format('{0}/00000000-0000-0000-0000-000000000002', toLower(format('{0}database', variables('prefixCleaned')))), '/')[1]), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned')))), '2022-09-01').outputs.resourceId.value, reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}containerBackend', variables('prefixCleaned')))), '2023-05-01', 'full').identity.principalId)]" |
| 6661 | + "value": "[format('az cosmosdb sql role assignment create --resource-group \"{0}\" --account-name \"{1}\" --role-definition-id \"{2}\" --scope \"{3}\" --principal-id \"{4}\"', resourceGroup().name, reference(resourceId('Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned')))), '2022-09-01').outputs.name.value, resourceId('Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', split(format('{0}/00000000-0000-0000-0000-000000000002', toLower(format('{0}database', variables('prefixCleaned')))), '/')[0], split(format('{0}/00000000-0000-0000-0000-000000000002', toLower(format('{0}database', variables('prefixCleaned')))), '/')[1]), reference(resourceId('Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned')))), '2022-09-01').outputs.resourceId.value, reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}containerBackend', variables('prefixCleaned')))), '2023-05-01', 'full').identity.principalId)]" |
6667 | 6662 | } |
6668 | 6663 | }, |
6669 | 6664 | "template": { |
|
7193 | 7188 | }, |
7194 | 7189 | "dependsOn": [ |
7195 | 7190 | "[resourceId('Microsoft.App/containerApps', toLower(format('{0}containerBackend', variables('prefixCleaned'))))]", |
7196 | | - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned'))))]", |
| 7191 | + "[resourceId('Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned'))))]", |
7197 | 7192 | "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_managed_identity')]" |
7198 | 7193 | ] |
7199 | 7194 | } |
|
0 commit comments