Skip to content

Commit bf882a9

Browse files
committed
reverting change
1 parent e9b9319 commit bf882a9

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

infra/main.bicep

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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')
4239
param tags object = {}
@@ -63,7 +60,7 @@ param capacity int = 140
6360

6461
var location = resourceGroup().location
6562
var modelVersion = '2024-08-06'
66-
var aiServicesName = '${solutionPrefix}-aiservices'
63+
var aiServicesName = '${prefix}-aiservices'
6764
var deploymentType = 'GlobalStandard'
6865
var gptModelVersion = 'gpt-4o'
6966
var appVersion = 'fnd01'
@@ -74,9 +71,9 @@ var dockerRegistryUrl = 'https://${resgistryName}.azurecr.io'
7471
var backendDockerImageURL = '${resgistryName}.azurecr.io/macaebackend:${appVersion}'
7572
var 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)}'
7875
var aoaiApiVersion = '2025-01-01-preview'
79-
var imageName = frontendDockerImageURL
76+
8077
resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2023-09-01' = {
8178
name: format(uniqueNameFormat, 'logs')
8279
location: location
@@ -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
150147
module 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,7 +161,7 @@ module kvault 'deploy_keyvault.bicep' = {
164161
module 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
@@ -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('')
282279
resource containerApp 'Microsoft.App/containerApps@2024-03-01' = {
283-
name: '${solutionPrefix}-backend'
280+
name: '${prefix}-backend'
284281
location: location
285282
tags: tags
286283
identity: {
@@ -414,7 +411,7 @@ resource frontendAppService 'Microsoft.Web/sites@2021-02-01' = {
414411
serverFarmId: frontendAppServicePlan.id
415412
reserved: true
416413
siteConfig: {
417-
linuxFxVersion: 'DOCKER|${imageName}'
414+
linuxFxVersion: 'DOCKER|${frontendDockerImageURL}'
418415
appSettings: [
419416
{
420417
name: 'DOCKER_REGISTRY_SERVER_URL'
@@ -449,7 +446,7 @@ resource frontendAppService 'Microsoft.Web/sites@2021-02-01' = {
449446
}
450447

451448
resource 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

455452
resource aiDeveloper 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
@@ -470,7 +467,7 @@ var cosmosAssignCli = 'az cosmosdb sql role assignment create --resource-group "
470467
module 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

infra/main.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "0.35.1.17967",
9-
"templateHash": "11782682784877206872"
9+
"templateHash": "18228555099764132241"
1010
}
1111
},
1212
"parameters": {
@@ -111,7 +111,6 @@
111111
"frontendDockerImageURL": "[format('{0}.azurecr.io/macaefrontend:{1}', variables('resgistryName'), variables('appVersion'))]",
112112
"uniqueNameFormat": "[format('{0}-{{0}}-{1}', parameters('prefix'), uniqueString(resourceGroup().id, parameters('prefix')))]",
113113
"aoaiApiVersion": "2025-01-01-preview",
114-
"imageName": "[variables('frontendDockerImageURL')]",
115114
"aiModelDeployments": [
116115
{
117116
"name": "[variables('gptModelVersion')]",
@@ -485,7 +484,7 @@
485484
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', format(variables('uniqueNameFormat'), 'frontend-plan'))]",
486485
"reserved": true,
487486
"siteConfig": {
488-
"linuxFxVersion": "[format('DOCKER|{0}', variables('imageName'))]",
487+
"linuxFxVersion": "[format('DOCKER|{0}', variables('frontendDockerImageURL'))]",
489488
"appSettings": [
490489
{
491490
"name": "DOCKER_REGISTRY_SERVER_URL",

0 commit comments

Comments
 (0)