Skip to content

Commit a579f71

Browse files
committed
Change naming conventions and ai to AzureAI
1 parent ed06de3 commit a579f71

File tree

4 files changed

+56
-54
lines changed

4 files changed

+56
-54
lines changed

infra/deploy_ai_foundry.bicep

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ param aiServicesEndpoint string
99
param aiServicesKey string
1010
param aiServicesId string
1111

12-
var storageName = '${solutionName}hubstorage'
12+
var storageName = '${solutionName}hubstr'
1313
var storageSkuName = 'Standard_LRS'
14-
var aiServicesName = '${solutionName}-aiservices'
15-
var workspaceName = '${solutionName}-workspace'
14+
var aiServicesName = '${solutionName}-ais'
15+
var workspaceName = '${solutionName}-wrksp'
1616
var keyvaultName = '${solutionName}-kv'
1717
var location = solutionLocation
18-
var aiHubName = '${solutionName}-aihub'
19-
var aiHubFriendlyName = aiHubName
18+
var azureAiHubName = '${solutionName}-aihub'
19+
var aiHubFriendlyName = azureAiHubName
2020
var aiHubDescription = 'AI Hub for KM template'
21-
var aiProjectName = '${solutionName}-aiproject'
21+
var aiProjectName = '${solutionName}-aiprj'
2222
var aiProjectFriendlyName = aiProjectName
23-
var aiSearchName = '${solutionName}-search'
23+
var aiSearchName = '${solutionName}-srch'
2424

2525

2626
resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = {
@@ -112,7 +112,7 @@ resource storageroleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-
112112
}
113113

114114
resource aiHub 'Microsoft.MachineLearningServices/workspaces@2023-08-01-preview' = {
115-
name: aiHubName
115+
name: azureAiHubName
116116
location: location
117117
identity: {
118118
type: 'SystemAssigned'
@@ -129,7 +129,7 @@ resource aiHub 'Microsoft.MachineLearningServices/workspaces@2023-08-01-preview'
129129
kind: 'hub'
130130

131131
resource aiServicesConnection 'connections@2024-07-01-preview' = {
132-
name: '${aiHubName}-connection-AzureOpenAI'
132+
name: '${azureAiHubName}-connection-AzureOpenAI'
133133
properties: {
134134
category: 'AIServices'
135135
target: aiServicesEndpoint

infra/deploy_managed_identity.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ param solutionName string
1010
param solutionLocation string
1111

1212
@description('Name')
13-
param miName string = '${ solutionName }-managed-identity'
13+
param miName string = '${ solutionName }-mng-id'
1414

1515
resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
1616
name: miName

infra/main.bicep

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ param Prefix string
3030
'westus3'
3131
])
3232
@description('Location for all Ai services resources. This location can be different from the resource group location.')
33-
param AiLocation string // The location used for all deployed resources. This location must be in the same region as the resource group.
33+
param AzureAiServiceLocation string // The location used for all deployed resources. This location must be in the same region as the resource group.
3434
param capacity int = 5
3535

3636
var uniqueId = toLower(uniqueString(subscription().id, Prefix, resourceGroup().location))
37-
var ResourcePrefix = 'cm${padLeft(take(uniqueId, 12), 12, '0')}'
38-
var imageVersion = 'rc1'
37+
var UniquePrefix = 'cm${padLeft(take(uniqueId, 12), 12, '0')}'
38+
var ResourcePrefix = take('cm${Prefix}${UniquePrefix}', 15)
39+
var imageVersion = 'rc1' // Change to 'fnd01' when ready
3940
var location = resourceGroup().location
4041
var dblocation = resourceGroup().location
4142
var cosmosdbDatabase = 'cmsadb'
@@ -46,9 +47,9 @@ var deploymentType = 'GlobalStandard'
4647
var containerName = 'appstorage'
4748
var llmModel = 'gpt-4o'
4849
var storageSkuName = 'Standard_LRS'
49-
var storageContainerName = '${ResourcePrefix}ctstor'
50+
var storageContainerName = '${ResourcePrefix}cts'
5051
var gptModelVersion = '2024-08-06'
51-
var aiServicesName = '${ResourcePrefix}-aiservices'
52+
var azureAiServicesName = '${ResourcePrefix}-ais'
5253

5354

5455

@@ -65,24 +66,24 @@ var aiModelDeployments = [
6566
}
6667
]
6768

68-
resource aiServices 'Microsoft.CognitiveServices/accounts@2024-04-01-preview' = {
69-
name: aiServicesName
69+
resource azureAiServices 'Microsoft.CognitiveServices/accounts@2024-04-01-preview' = {
70+
name: azureAiServicesName
7071
location: location
7172
sku: {
7273
name: 'S0'
7374
}
7475
kind: 'AIServices'
7576
properties: {
76-
customSubDomainName: aiServicesName
77+
customSubDomainName: azureAiServicesName
7778
apiProperties: {
7879
statisticsEnabled: false
7980
}
8081
}
8182
}
8283

8384
@batchSize(1)
84-
resource aiServicesDeployments 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01' = [for aiModeldeployment in aiModelDeployments: {
85-
parent: aiServices //aiServices_m
85+
resource azureAiServicesDeployments 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01' = [for aiModeldeployment in aiModelDeployments: {
86+
parent: azureAiServices //aiServices_m
8687
name: aiModeldeployment.name
8788
properties: {
8889
model: {
@@ -124,26 +125,26 @@ module kvault 'deploy_keyvault.bicep' = {
124125

125126

126127
// ==========AI Foundry and related resources ========== //
127-
module aifoundry 'deploy_ai_foundry.bicep' = {
128+
module azureAifoundry 'deploy_ai_foundry.bicep' = {
128129
name: 'deploy_ai_foundry'
129130
params: {
130131
solutionName: ResourcePrefix
131-
solutionLocation: AiLocation
132+
solutionLocation: AzureAiServiceLocation
132133
keyVaultName: kvault.outputs.keyvaultName
133134
gptModelName: llmModel
134135
gptModelVersion: gptModelVersion
135136
managedIdentityObjectId:managedIdentityModule.outputs.managedIdentityOutput.objectId
136-
aiServicesEndpoint: aiServices.properties.endpoint
137-
aiServicesKey: aiServices.listKeys().key1
138-
aiServicesId: aiServices.id
137+
aiServicesEndpoint: azureAiServices.properties.endpoint
138+
aiServicesKey: azureAiServices.listKeys().key1
139+
aiServicesId: azureAiServices.id
139140
}
140141
scope: resourceGroup(resourceGroup().name)
141142
}
142143

143144
module containerAppsEnvironment 'br/public:avm/res/app/managed-environment:0.9.1' = {
144145
name: toLower('${ResourcePrefix}conAppsEnv')
145146
params: {
146-
logAnalyticsWorkspaceResourceId: aifoundry.outputs.logAnalyticsId
147+
logAnalyticsWorkspaceResourceId: azureAifoundry.outputs.logAnalyticsId
147148
name: toLower('${ResourcePrefix}manenv')
148149
location: location
149150
zoneRedundant: false
@@ -310,7 +311,7 @@ resource containerAppBackend 'Microsoft.App/containerApps@2023-05-01' = {
310311
}
311312
{
312313
name: 'AZURE_OPENAI_ENDPOINT'
313-
value: 'https://${aifoundry.outputs.aiServicesName}.openai.azure.com/'
314+
value: 'https://${azureAifoundry.outputs.aiServicesName}.openai.azure.com/'
314315
}
315316
{
316317
name: 'MIGRATOR_AGENT_MODEL_DEPLOY'
@@ -413,7 +414,7 @@ var openAiContributorRoleId = 'a001fd3d-188f-4b5d-821b-7da978bf7442' // Fixed R
413414

414415
resource openAiRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
415416
name: guid(containerAppBackend.id, openAiContributorRoleId)
416-
scope: aiServices
417+
scope: azureAiServices
417418
properties: {
418419
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', openAiContributorRoleId) // OpenAI Service Contributor
419420
principalId: containerAppBackend.identity.principalId
@@ -430,7 +431,7 @@ resource containers 'Microsoft.Storage/storageAccounts/blobServices/containers@2
430431
properties: {
431432
publicAccess: 'None'
432433
}
433-
dependsOn: [aifoundry]
434+
dependsOn: [azureAifoundry]
434435
}]
435436

436437

infra/main.json

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"_generator": {
66
"name": "bicep",
77
"version": "0.34.44.8038",
8-
"templateHash": "13937422806437579370"
8+
"templateHash": "372840055428460103"
99
}
1010
},
1111
"parameters": {
@@ -17,7 +17,7 @@
1717
"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."
1818
}
1919
},
20-
"AiLocation": {
20+
"AzureAiServiceLocation": {
2121
"type": "string",
2222
"allowedValues": [
2323
"australiaeast",
@@ -55,7 +55,8 @@
5555
},
5656
"variables": {
5757
"uniqueId": "[toLower(uniqueString(subscription().id, parameters('Prefix'), resourceGroup().location))]",
58-
"ResourcePrefix": "[format('cm{0}', padLeft(take(variables('uniqueId'), 12), 12, '0'))]",
58+
"UniquePrefix": "[format('cm{0}', padLeft(take(variables('uniqueId'), 12), 12, '0'))]",
59+
"ResourcePrefix": "[take(format('cm{0}{1}', parameters('Prefix'), variables('UniquePrefix')), 15)]",
5960
"imageVersion": "rc1",
6061
"location": "[resourceGroup().location]",
6162
"dblocation": "[resourceGroup().location]",
@@ -67,9 +68,9 @@
6768
"containerName": "appstorage",
6869
"llmModel": "gpt-4o",
6970
"storageSkuName": "Standard_LRS",
70-
"storageContainerName": "[format('{0}ctstor', variables('ResourcePrefix'))]",
71+
"storageContainerName": "[format('{0}cts', variables('ResourcePrefix'))]",
7172
"gptModelVersion": "2024-08-06",
72-
"aiServicesName": "[format('{0}-aiservices', variables('ResourcePrefix'))]",
73+
"azureAiServicesName": "[format('{0}-ais', variables('ResourcePrefix'))]",
7374
"aiModelDeployments": [
7475
{
7576
"name": "[variables('llmModel')]",
@@ -91,29 +92,29 @@
9192
{
9293
"type": "Microsoft.CognitiveServices/accounts",
9394
"apiVersion": "2024-04-01-preview",
94-
"name": "[variables('aiServicesName')]",
95+
"name": "[variables('azureAiServicesName')]",
9596
"location": "[variables('location')]",
9697
"sku": {
9798
"name": "S0"
9899
},
99100
"kind": "AIServices",
100101
"properties": {
101-
"customSubDomainName": "[variables('aiServicesName')]",
102+
"customSubDomainName": "[variables('azureAiServicesName')]",
102103
"apiProperties": {
103104
"statisticsEnabled": false
104105
}
105106
}
106107
},
107108
{
108109
"copy": {
109-
"name": "aiServicesDeployments",
110+
"name": "azureAiServicesDeployments",
110111
"count": "[length(variables('aiModelDeployments'))]",
111112
"mode": "serial",
112113
"batchSize": 1
113114
},
114115
"type": "Microsoft.CognitiveServices/accounts/deployments",
115116
"apiVersion": "2023-05-01",
116-
"name": "[format('{0}/{1}', variables('aiServicesName'), variables('aiModelDeployments')[copyIndex()].name)]",
117+
"name": "[format('{0}/{1}', variables('azureAiServicesName'), variables('aiModelDeployments')[copyIndex()].name)]",
117118
"properties": {
118119
"model": {
119120
"format": "OpenAI",
@@ -127,7 +128,7 @@
127128
"capacity": "[variables('aiModelDeployments')[copyIndex()].sku.capacity]"
128129
},
129130
"dependsOn": [
130-
"[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]"
131+
"[resourceId('Microsoft.CognitiveServices/accounts', variables('azureAiServicesName'))]"
131132
]
132133
},
133134
{
@@ -302,14 +303,14 @@
302303
{
303304
"type": "Microsoft.Authorization/roleAssignments",
304305
"apiVersion": "2022-04-01",
305-
"scope": "[format('Microsoft.CognitiveServices/accounts/{0}', variables('aiServicesName'))]",
306+
"scope": "[format('Microsoft.CognitiveServices/accounts/{0}', variables('azureAiServicesName'))]",
306307
"name": "[guid(resourceId('Microsoft.App/containerApps', toLower(format('{0}Backend', variables('ResourcePrefix')))), variables('openAiContributorRoleId'))]",
307308
"properties": {
308309
"roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', variables('openAiContributorRoleId'))]",
309310
"principalId": "[reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}Backend', variables('ResourcePrefix')))), '2023-05-01', 'full').identity.principalId]"
310311
},
311312
"dependsOn": [
312-
"[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]",
313+
"[resourceId('Microsoft.CognitiveServices/accounts', variables('azureAiServicesName'))]",
313314
"[resourceId('Microsoft.App/containerApps', toLower(format('{0}Backend', variables('ResourcePrefix'))))]"
314315
]
315316
},
@@ -353,7 +354,7 @@
353354
"_generator": {
354355
"name": "bicep",
355356
"version": "0.34.44.8038",
356-
"templateHash": "17863870312619064541"
357+
"templateHash": "15524749849693178338"
357358
}
358359
},
359360
"parameters": {
@@ -373,7 +374,7 @@
373374
},
374375
"miName": {
375376
"type": "string",
376-
"defaultValue": "[format('{0}-managed-identity', parameters('solutionName'))]",
377+
"defaultValue": "[format('{0}-mng-id', parameters('solutionName'))]",
377378
"metadata": {
378379
"description": "Name"
379380
}
@@ -558,7 +559,7 @@
558559
"value": "[variables('ResourcePrefix')]"
559560
},
560561
"solutionLocation": {
561-
"value": "[parameters('AiLocation')]"
562+
"value": "[parameters('AzureAiServiceLocation')]"
562563
},
563564
"keyVaultName": {
564565
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_keyvault'), '2022-09-01').outputs.keyvaultName.value]"
@@ -573,13 +574,13 @@
573574
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_managed_identity'), '2022-09-01').outputs.managedIdentityOutput.value.objectId]"
574575
},
575576
"aiServicesEndpoint": {
576-
"value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName')), '2024-04-01-preview').endpoint]"
577+
"value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('azureAiServicesName')), '2024-04-01-preview').endpoint]"
577578
},
578579
"aiServicesKey": {
579-
"value": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName')), '2024-04-01-preview').key1]"
580+
"value": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', variables('azureAiServicesName')), '2024-04-01-preview').key1]"
580581
},
581582
"aiServicesId": {
582-
"value": "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]"
583+
"value": "[resourceId('Microsoft.CognitiveServices/accounts', variables('azureAiServicesName'))]"
583584
}
584585
},
585586
"template": {
@@ -589,7 +590,7 @@
589590
"_generator": {
590591
"name": "bicep",
591592
"version": "0.34.44.8038",
592-
"templateHash": "12550713338937452696"
593+
"templateHash": "1990190368109519471"
593594
}
594595
},
595596
"parameters": {
@@ -622,18 +623,18 @@
622623
}
623624
},
624625
"variables": {
625-
"storageName": "[format('{0}hubstorage', parameters('solutionName'))]",
626+
"storageName": "[format('{0}hubstr', parameters('solutionName'))]",
626627
"storageSkuName": "Standard_LRS",
627-
"aiServicesName": "[format('{0}-aiservices', parameters('solutionName'))]",
628-
"workspaceName": "[format('{0}-workspace', parameters('solutionName'))]",
628+
"aiServicesName": "[format('{0}-ais', parameters('solutionName'))]",
629+
"workspaceName": "[format('{0}-wrksp', parameters('solutionName'))]",
629630
"keyvaultName": "[format('{0}-kv', parameters('solutionName'))]",
630631
"location": "[parameters('solutionLocation')]",
631632
"aiHubName": "[format('{0}-aihub', parameters('solutionName'))]",
632633
"aiHubFriendlyName": "[variables('aiHubName')]",
633634
"aiHubDescription": "AI Hub for KM template",
634-
"aiProjectName": "[format('{0}-aiproject', parameters('solutionName'))]",
635+
"aiProjectName": "[format('{0}-aiprj', parameters('solutionName'))]",
635636
"aiProjectFriendlyName": "[variables('aiProjectName')]",
636-
"aiSearchName": "[format('{0}-search', parameters('solutionName'))]",
637+
"aiSearchName": "[format('{0}-srch', parameters('solutionName'))]",
637638
"storageNameCleaned": "[replace(variables('storageName'), '-', '')]"
638639
},
639640
"resources": [
@@ -943,7 +944,7 @@
943944
}
944945
},
945946
"dependsOn": [
946-
"[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]",
947+
"[resourceId('Microsoft.CognitiveServices/accounts', variables('azureAiServicesName'))]",
947948
"[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_keyvault')]",
948949
"[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_managed_identity')]"
949950
]

0 commit comments

Comments
 (0)