@@ -32,11 +32,8 @@ param azureOpenAILocation string //= 'eastus2' // The location used for all depl
3232
3333@minLength (3 )
3434@maxLength (20 )
35- @description ('A unique prefix for all resources in this deployment. This should be 3-20 characters long:' )
36- param environmentName string
37-
38- var uniqueId = toLower (uniqueString (subscription ().id , environmentName , resourceGroup ().location ))
39- var solutionPrefix = 'ma${padLeft (take (uniqueId , 12 ), 12 , '0' )}'
35+ @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.' )
36+ param prefix string //= 'macae'
4037
4138@description ('Tags to apply to all deployed resources' )
4239param tags object = {}
@@ -63,7 +60,7 @@ param capacity int = 140
6360
6461var location = resourceGroup ().location
6562var modelVersion = '2024-08-06'
66- var aiServicesName = '${solutionPrefix }-aiservices'
63+ var aiServicesName = '${prefix }-aiservices'
6764var deploymentType = 'GlobalStandard'
6865var gptModelVersion = 'gpt-4o'
6966var appVersion = 'fnd01'
@@ -74,7 +71,7 @@ var dockerRegistryUrl = 'https://${resgistryName}.azurecr.io'
7471var backendDockerImageURL = '${resgistryName }.azurecr.io/macaebackend:${appVersion }'
7572var frontendDockerImageURL = '${resgistryName }.azurecr.io/macaefrontend:${appVersion }'
7673
77- var uniqueNameFormat = '${solutionPrefix }-{0}-${uniqueString (resourceGroup ().id , solutionPrefix )}'
74+ var uniqueNameFormat = '${prefix }-{0}-${uniqueString (resourceGroup ().id , prefix )}'
7875var aoaiApiVersion = '2025-01-01-preview'
7976
8077resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2023-09-01' = {
@@ -124,7 +121,7 @@ resource aiServices 'Microsoft.CognitiveServices/accounts@2024-04-01-preview' =
124121 apiProperties : {
125122 //statisticsEnabled: false
126123 }
127- // disableLocalAuth: true
124+ disableLocalAuth : true
128125 }
129126}
130127
@@ -150,7 +147,7 @@ resource aiServicesDeployments 'Microsoft.CognitiveServices/accounts/deployments
150147module kvault 'deploy_keyvault.bicep' = {
151148 name : 'deploy_keyvault'
152149 params : {
153- solutionName : solutionPrefix
150+ solutionName : prefix
154151 solutionLocation : location
155152 managedIdentityObjectId : managedIdentityModule .outputs .managedIdentityOutput .objectId
156153 }
@@ -164,14 +161,14 @@ module kvault 'deploy_keyvault.bicep' = {
164161module aifoundry 'deploy_ai_foundry.bicep' = {
165162 name : 'deploy_ai_foundry'
166163 params : {
167- solutionName : solutionPrefix
164+ solutionName : prefix
168165 solutionLocation : azureOpenAILocation
169166 keyVaultName : kvault .outputs .keyvaultName
170167 gptModelName : gptModelVersion
171168 gptModelVersion : gptModelVersion
172169 managedIdentityObjectId : managedIdentityModule .outputs .managedIdentityOutput .objectId
173170 aiServicesEndpoint : aiServices .properties .endpoint
174- aiServicesKey : aiServices . listKeys (). key1
171+ aiServices : aiServices
175172 aiServicesId : aiServices .id
176173 }
177174 scope : resourceGroup (resourceGroup ().name )
@@ -206,7 +203,7 @@ resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2024-05-15' = {
206203 }
207204 ]
208205 capabilities : [{ name : 'EnableServerless' }]
209- // disableLocalAuth: true
206+ disableLocalAuth : true
210207 }
211208
212209 resource contributorRoleDefinition 'sqlRoleDefinitions' existing = {
@@ -280,7 +277,7 @@ resource acaCosomsRoleAssignment 'Microsoft.DocumentDB/databaseAccounts/sqlRoleA
280277
281278@description ('' )
282279resource containerApp 'Microsoft.App/containerApps@2024-03-01' = {
283- name : '${solutionPrefix }-backend'
280+ name : '${prefix }-backend'
284281 location : location
285282 tags : tags
286283 identity : {
@@ -449,7 +446,7 @@ resource frontendAppService 'Microsoft.Web/sites@2021-02-01' = {
449446}
450447
451448resource aiHubProject 'Microsoft.MachineLearningServices/workspaces@2024-01-01-preview' existing = {
452- name : '${solutionPrefix }-aiproject' // aiProjectName must be calculated - available at main start.
449+ name : '${prefix }-aiproject' // aiProjectName must be calculated - available at main start.
453450}
454451
455452resource aiDeveloper 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
@@ -470,7 +467,7 @@ var cosmosAssignCli = 'az cosmosdb sql role assignment create --resource-group "
470467module managedIdentityModule 'deploy_managed_identity.bicep' = {
471468 name : 'deploy_managed_identity'
472469 params : {
473- solutionName : solutionPrefix
470+ solutionName : prefix
474471 //solutionLocation: location
475472 managedIdentityId : pullIdentity .id
476473 managedIdentityPropPrin : pullIdentity .properties .principalId
0 commit comments