|
6 | 6 | "_generator": { |
7 | 7 | "name": "bicep", |
8 | 8 | "version": "0.34.44.8038", |
9 | | - "templateHash": "7719893060553487435" |
| 9 | + "templateHash": "8198085377798825433" |
10 | 10 | } |
11 | 11 | }, |
12 | 12 | "parameters": { |
|
48 | 48 | "description": "Location for all Ai services resources. This location can be different from the resource group location." |
49 | 49 | } |
50 | 50 | }, |
51 | | - "prefix": { |
| 51 | + "environmentName": { |
52 | 52 | "type": "string", |
53 | | - "defaultValue": "macae", |
54 | 53 | "minLength": 3, |
55 | 54 | "maxLength": 20, |
56 | 55 | "metadata": { |
57 | | - "description": "Prefix for all resources created by this template. This prefix will be used to create unique names for all resources. The prefix must be unique within the resource group." |
| 56 | + "description": "A unique prefix for all resources in this deployment. This should be 3-20 characters long:" |
58 | 57 | } |
59 | 58 | }, |
60 | 59 | "tags": { |
|
107 | 106 | } |
108 | 107 | }, |
109 | 108 | "variables": { |
| 109 | + "uniqueId": "[toLower(uniqueString(subscription().id, parameters('environmentName'), resourceGroup().location))]", |
| 110 | + "solutionPrefix": "[format('ma{0}', padLeft(take(variables('uniqueId'), 12), 12, '0'))]", |
110 | 111 | "modelVersion": "2024-08-06", |
111 | | - "aiServicesName": "[format('{0}-aiservices', parameters('prefix'))]", |
| 112 | + "aiServicesName": "[format('{0}-aiservices', variables('solutionPrefix'))]", |
112 | 113 | "deploymentType": "GlobalStandard", |
113 | 114 | "gptModelVersion": "gpt-4o", |
114 | | - "appVersion": "fnd01", |
| 115 | + "appVersion": "auj01", |
115 | 116 | "resgistryName": "biabcontainerreg", |
116 | 117 | "dockerRegistryUrl": "[format('https://{0}.azurecr.io', variables('resgistryName'))]", |
117 | 118 | "backendDockerImageURL": "[format('{0}.azurecr.io/macaebackend:{1}', variables('resgistryName'), variables('appVersion'))]", |
118 | 119 | "frontendDockerImageURL": "[format('{0}.azurecr.io/macaefrontend:{1}', variables('resgistryName'), variables('appVersion'))]", |
119 | | - "uniqueNameFormat": "[format('{0}-{{0}}-{1}', parameters('prefix'), uniqueString(resourceGroup().id, parameters('prefix')))]", |
| 120 | + "uniqueNameFormat": "[format('{0}-{{0}}-{1}', variables('solutionPrefix'), uniqueString(resourceGroup().id, variables('solutionPrefix')))]", |
120 | 121 | "aoaiApiVersion": "2025-01-01-preview", |
121 | 122 | "aiModelDeployments": [ |
122 | 123 | { |
|
224 | 225 | "kind": "AIServices", |
225 | 226 | "properties": { |
226 | 227 | "customSubDomainName": "[variables('aiServicesName')]", |
227 | | - "apiProperties": {}, |
228 | | - "disableLocalAuth": true |
| 228 | + "apiProperties": {} |
229 | 229 | } |
230 | 230 | }, |
231 | 231 | "aiServicesDeployments": { |
|
262 | 262 | "type": "Microsoft.Authorization/roleAssignments", |
263 | 263 | "apiVersion": "2022-04-01", |
264 | 264 | "scope": "[format('Microsoft.CognitiveServices/accounts/{0}', variables('aiServicesName'))]", |
265 | | - "name": "[guid(resourceId('Microsoft.App/containerApps', format('{0}-backend', parameters('prefix'))), resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName')), resourceId('Microsoft.Authorization/roleDefinitions', '5e0bd9bd-7b93-4f28-af87-19fc36ad61bd'))]", |
| 265 | + "name": "[guid(resourceId('Microsoft.App/containerApps', format('{0}-backend', variables('solutionPrefix'))), resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName')), resourceId('Microsoft.Authorization/roleDefinitions', '5e0bd9bd-7b93-4f28-af87-19fc36ad61bd'))]", |
266 | 266 | "properties": { |
267 | 267 | "principalId": "[reference('containerApp', '2024-03-01', 'full').identity.principalId]", |
268 | 268 | "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', '5e0bd9bd-7b93-4f28-af87-19fc36ad61bd')]", |
|
293 | 293 | { |
294 | 294 | "name": "EnableServerless" |
295 | 295 | } |
296 | | - ], |
297 | | - "disableLocalAuth": true |
| 296 | + ] |
298 | 297 | } |
299 | 298 | }, |
300 | 299 | "pullIdentity": { |
|
327 | 326 | "acaCosomsRoleAssignment": { |
328 | 327 | "type": "Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments", |
329 | 328 | "apiVersion": "2024-05-15", |
330 | | - "name": "[format('{0}/{1}', format(variables('uniqueNameFormat'), 'cosmos'), guid(resourceId('Microsoft.App/containerApps', format('{0}-backend', parameters('prefix'))), resourceId('Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', format(variables('uniqueNameFormat'), 'cosmos'), '00000000-0000-0000-0000-000000000002')))]", |
| 329 | + "name": "[format('{0}/{1}', format(variables('uniqueNameFormat'), 'cosmos'), guid(resourceId('Microsoft.App/containerApps', format('{0}-backend', variables('solutionPrefix'))), resourceId('Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', format(variables('uniqueNameFormat'), 'cosmos'), '00000000-0000-0000-0000-000000000002')))]", |
331 | 330 | "properties": { |
332 | 331 | "principalId": "[reference('containerApp', '2024-03-01', 'full').identity.principalId]", |
333 | 332 | "roleDefinitionId": "[resourceId('Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', format(variables('uniqueNameFormat'), 'cosmos'), '00000000-0000-0000-0000-000000000002')]", |
|
341 | 340 | "containerApp": { |
342 | 341 | "type": "Microsoft.App/containerApps", |
343 | 342 | "apiVersion": "2024-03-01", |
344 | | - "name": "[format('{0}-backend', parameters('prefix'))]", |
| 343 | + "name": "[format('{0}-backend', variables('solutionPrefix'))]", |
345 | 344 | "location": "[parameters('location')]", |
346 | 345 | "tags": "[parameters('tags')]", |
347 | 346 | "identity": { |
|
532 | 531 | "existing": true, |
533 | 532 | "type": "Microsoft.MachineLearningServices/workspaces", |
534 | 533 | "apiVersion": "2024-01-01-preview", |
535 | | - "name": "[format('{0}-aiproject', parameters('prefix'))]" |
| 534 | + "name": "[format('{0}-aiproject', variables('solutionPrefix'))]" |
536 | 535 | }, |
537 | 536 | "aiDeveloper": { |
538 | 537 | "existing": true, |
|
543 | 542 | "aiDeveloperAccessProj": { |
544 | 543 | "type": "Microsoft.Authorization/roleAssignments", |
545 | 544 | "apiVersion": "2022-04-01", |
546 | | - "scope": "[format('Microsoft.MachineLearningServices/workspaces/{0}', format('{0}-aiproject', parameters('prefix')))]", |
547 | | - "name": "[guid(format('{0}-backend', parameters('prefix')), resourceId('Microsoft.MachineLearningServices/workspaces', format('{0}-aiproject', parameters('prefix'))), resourceId('Microsoft.Authorization/roleDefinitions', '64702f94-c441-49e6-a78b-ef80e0188fee'))]", |
| 545 | + "scope": "[format('Microsoft.MachineLearningServices/workspaces/{0}', format('{0}-aiproject', variables('solutionPrefix')))]", |
| 546 | + "name": "[guid(format('{0}-backend', variables('solutionPrefix')), resourceId('Microsoft.MachineLearningServices/workspaces', format('{0}-aiproject', variables('solutionPrefix'))), resourceId('Microsoft.Authorization/roleDefinitions', '64702f94-c441-49e6-a78b-ef80e0188fee'))]", |
548 | 547 | "properties": { |
549 | 548 | "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', '64702f94-c441-49e6-a78b-ef80e0188fee')]", |
550 | 549 | "principalId": "[reference('containerApp', '2024-03-01', 'full').identity.principalId]" |
|
565 | 564 | "mode": "Incremental", |
566 | 565 | "parameters": { |
567 | 566 | "solutionName": { |
568 | | - "value": "[parameters('prefix')]" |
| 567 | + "value": "[variables('solutionPrefix')]" |
569 | 568 | }, |
570 | 569 | "solutionLocation": { |
571 | 570 | "value": "[parameters('location')]" |
|
685 | 684 | "mode": "Incremental", |
686 | 685 | "parameters": { |
687 | 686 | "solutionName": { |
688 | | - "value": "[parameters('prefix')]" |
| 687 | + "value": "[variables('solutionPrefix')]" |
689 | 688 | }, |
690 | 689 | "solutionLocation": { |
691 | 690 | "value": "[parameters('azureOpenAILocation')]" |
|
1094 | 1093 | "mode": "Incremental", |
1095 | 1094 | "parameters": { |
1096 | 1095 | "solutionName": { |
1097 | | - "value": "[parameters('prefix')]" |
| 1096 | + "value": "[variables('solutionPrefix')]" |
1098 | 1097 | }, |
1099 | 1098 | "managedIdentityId": { |
1100 | 1099 | "value": "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', format(variables('uniqueNameFormat'), 'containerapp-pull'))]" |
|
0 commit comments