Skip to content

Commit 244e5a8

Browse files
update resource naming conventions
1 parent cf8d934 commit 244e5a8

10 files changed

Lines changed: 43 additions & 24 deletions

File tree

infra/main.bicep

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ param location string = resourceGroup().location
3636
azd : {
3737
type: 'location'
3838
usageName : [
39-
'OpenAI.GlobalStandard.gpt-4o, 150'
39+
'OpenAI.GlobalStandard.gpt-4o, 5'
4040
]
4141
}
4242
})
4343
@description('Optional. Location for all AI service resources. This location can be different from the resource group location.')
4444
param aiDeploymentsLocation string
4545

4646
@description('Optional. AI model deployment token capacity. Defaults to 150K tokens per minute.')
47-
param capacity int = 150
47+
param capacity int = 5
4848

4949
@description('Optional. Enable monitoring for the resources. This will enable Application Insights and Log Analytics. Defaults to false.')
5050
param enableMonitoring bool = useWafAlignedArchitecture? true : false
@@ -129,6 +129,8 @@ var modelDeployment = {
129129
raiPolicyName: 'Microsoft.Default'
130130
}
131131

132+
var abbrs = loadJsonContent('./abbreviations.json')
133+
132134
#disable-next-line no-deployments-resources
133135
resource avmTelemetry 'Microsoft.Resources/deployments@2024-03-01' = if (enableTelemetry) {
134136
name: take(
@@ -154,7 +156,7 @@ resource avmTelemetry 'Microsoft.Resources/deployments@2024-03-01' = if (enableT
154156
module appIdentity 'br/public:avm/res/managed-identity/user-assigned-identity:0.4.1' = {
155157
name: take('identity-app-${resourcesName}-deployment', 64)
156158
params: {
157-
name: 'id-app-${resourcesName}'
159+
name: '${abbrs.security.managedIdentity}${resourcesName}'
158160
location: location
159161
tags: allTags
160162
enableTelemetry: enableTelemetry
@@ -176,7 +178,7 @@ resource existingLogAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces
176178
module logAnalyticsWorkspace 'br/public:avm/res/operational-insights/workspace:0.11.2' = if ((enableMonitoring || enablePrivateNetworking) && !useExistingLogAnalytics) {
177179
name: take('log-analytics-${resourcesName}-deployment', 64)
178180
params: {
179-
name: 'log-${resourcesName}'
181+
name: '${abbrs.managementGovernance.logAnalyticsWorkspace}${resourcesName}'
180182
location: location
181183
skuName: 'PerGB2018'
182184
dataRetention: 30
@@ -194,7 +196,7 @@ var LogAnalyticsWorkspaceId = useExistingLogAnalytics? existingLogAnalyticsWorks
194196
module applicationInsights 'br/public:avm/res/insights/component:0.6.0' = if (enableMonitoring) {
195197
name: take('app-insights-${resourcesName}-deployment', 64)
196198
params: {
197-
name: 'appi-${resourcesName}'
199+
name: '${abbrs.managementGovernance.applicationInsights}${resourcesName}'
198200
location: location
199201
workspaceResourceId: logAnalyticsWorkspaceResourceId
200202
diagnosticSettings: [{ workspaceResourceId: logAnalyticsWorkspaceResourceId }]
@@ -223,12 +225,12 @@ module aiServices 'modules/ai-foundry/main.bicep' = {
223225
#disable-next-line no-unnecessary-dependson
224226
dependsOn: [logAnalyticsWorkspace, network] // required due to optional flags that could change dependency
225227
params: {
226-
name: 'ais-${resourcesName}'
228+
name: '${abbrs.ai.aiFoundry}${resourcesName}'
227229
location: aiDeploymentsLocation
228230
sku: 'S0'
229231
kind: 'AIServices'
230232
deployments: [modelDeployment]
231-
projectName: 'proj-${resourcesName}'
233+
projectName: '${abbrs.ai.aiFoundryProject}${resourcesName}'
232234
logAnalyticsWorkspaceResourceId: enableMonitoring ? logAnalyticsWorkspaceResourceId : ''
233235
privateNetworking: enablePrivateNetworking
234236
? {
@@ -265,7 +267,7 @@ module storageAccount 'modules/storageAccount.bicep' = {
265267
#disable-next-line no-unnecessary-dependson
266268
dependsOn: [logAnalyticsWorkspace, network] // required due to optional flags that could change dependency
267269
params: {
268-
name: take('st${resourcesName}', 24)
270+
name: take('${abbrs.storage.storageAccount}${resourcesName}', 24)
269271
location: location
270272
tags: allTags
271273
skuName: enableRedundancy ? 'Standard_GZRS' : 'Standard_LRS'
@@ -300,7 +302,7 @@ module keyVault 'modules/keyVault.bicep' = {
300302
#disable-next-line no-unnecessary-dependson
301303
dependsOn: [logAnalyticsWorkspace, network] // required due to optional flags that could change dependency
302304
params: {
303-
name: take('kv-${resourcesName}', 24)
305+
name: take('${abbrs.security.keyVault}${resourcesName}', 24)
304306
location: location
305307
sku: 'standard'
306308
logAnalyticsWorkspaceResourceId: enableMonitoring ? logAnalyticsWorkspaceResourceId : ''
@@ -327,7 +329,7 @@ module cosmosDb 'modules/cosmosDb.bicep' = {
327329
#disable-next-line no-unnecessary-dependson
328330
dependsOn: [logAnalyticsWorkspace, network] // required due to optional flags that could change dependency
329331
params: {
330-
name: take('cosmos-${resourcesName}', 44)
332+
name: take('${abbrs.databases.cosmosDBDatabase}${resourcesName}', 44)
331333
location: location
332334
dataAccessIdentityPrincipalId: appIdentity.outputs.principalId
333335
logAnalyticsWorkspaceResourceId: enableMonitoring ? logAnalyticsWorkspaceResourceId : ''
@@ -344,7 +346,7 @@ module cosmosDb 'modules/cosmosDb.bicep' = {
344346
}
345347
}
346348

347-
var containerAppsEnvironmentName = 'cae-${resourcesName}'
349+
var containerAppsEnvironmentName = '${abbrs.containers.containerAppsEnvironment}${resourcesName}'
348350

349351
module containerAppsEnvironment 'br/public:avm/res/app/managed-environment:0.11.2' = {
350352
name: take('container-env-${resourcesName}-deployment', 64)
@@ -391,7 +393,7 @@ module containerAppBackend 'br/public:avm/res/app/container-app:0.17.0' = {
391393
#disable-next-line no-unnecessary-dependson
392394
dependsOn: [applicationInsights] // required due to optional flags that could change dependency
393395
params: {
394-
name: take('ca-${resourcesName}backend', 32)
396+
name: take('${abbrs.containers.containerApp}backend-${resourcesName}', 32)
395397
location: location
396398
environmentResourceId: containerAppsEnvironment.outputs.resourceId
397399
managedIdentities: {
@@ -556,7 +558,7 @@ module containerAppBackend 'br/public:avm/res/app/container-app:0.17.0' = {
556558
module containerAppFrontend 'br/public:avm/res/app/container-app:0.17.0' = {
557559
name: take('container-app-frontend-${resourcesName}-deployment', 64)
558560
params: {
559-
name: take('ca-${resourcesName}frontend', 32)
561+
name: take('${abbrs.containers.containerApp}frontend-${resourcesName}', 32)
560562
location: location
561563
environmentResourceId: containerAppsEnvironment.outputs.resourceId
562564
managedIdentities: {

infra/modules/ai-foundry/main.bicep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ module cognitiveService 'ai-services.bicep' = {
155155
privateEndpoints: privateNetworking != null
156156
? [
157157
{
158-
name:'pep-${name}-aiservices' // private endpoint name
159-
customNetworkInterfaceName: 'nic-${name}-aiservices'
158+
name:'pep-${name}' // private endpoint name
159+
customNetworkInterfaceName: 'nic-${name}'
160160
subnetResourceId: privateNetworking.?subnetResourceId ?? ''
161161
privateDnsZoneGroup: {
162162
privateDnsZoneGroupConfigs: [

infra/modules/cosmosDb.bicep

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ module cosmosAccount 'br/public:avm/res/document-db/database-account:0.15.0' = {
9797
privateEndpoints: privateNetworking != null
9898
? [
9999
{
100+
name: 'pep-${name}'
101+
customNetworkInterfaceName: 'nic-${name}'
100102
privateDnsZoneGroup: {
101103
privateDnsZoneGroupConfigs: [
102104
{

infra/modules/keyVault.bicep

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ module keyvault 'br/public:avm/res/key-vault/vault:0.12.1' = {
7878
privateEndpoints: privateNetworking != null
7979
? [
8080
{
81+
name: 'pep-${name}'
82+
customNetworkInterfaceName: 'nic-${name}'
8183
privateDnsZoneGroup: {
8284
privateDnsZoneGroupConfigs: [
8385
{

infra/modules/network.bicep

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ module network 'network/main.bicep' = {
7878
name: 'web'
7979
addressPrefixes: ['10.0.0.0/23'] // /23 (10.0.0.0 - 10.0.1.255), 512 addresses
8080
networkSecurityGroup: {
81-
name: 'web-nsg'
81+
name: 'nsg-web'
8282
securityRules: [
8383
{
8484
name: 'AllowHttpsInbound'
@@ -128,10 +128,14 @@ module network 'network/main.bicep' = {
128128
addressPrefixes: ['10.0.2.0/23'] // /23 (10.0.2.0 - 10.0.3.255), 512 addresses
129129
privateEndpointNetworkPolicies: 'Disabled'
130130
privateLinkServiceNetworkPolicies: 'Disabled'
131+
networkSecurityGroup: {
132+
name: 'nsg-peps'
133+
securityRules:[]
134+
}
131135
}
132136
]
133137
bastionConfiguration: {
134-
name: 'bastion-${resourcesName}'
138+
name: 'bas-${resourcesName}'
135139
subnetAddressPrefixes: ['10.0.10.0/26']
136140
}
137141
jumpboxConfiguration: {
@@ -143,7 +147,7 @@ module network 'network/main.bicep' = {
143147
name: 'jumpbox'
144148
addressPrefixes: ['10.0.12.0/23'] // /23 (10.0.12.0 - 10.0.13.255), 512 addresses
145149
networkSecurityGroup: {
146-
name: 'jumpbox-nsg'
150+
name: 'nsg-jumbox'
147151
securityRules: [
148152
{
149153
name: 'AllowRdpFromBastion'

infra/modules/network/bastionHost.bicep

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ module bastionHost 'br/public:avm/res/network/bastion-host:0.6.1' = {
6262
]
6363
tags: tags
6464
enableTelemetry: enableTelemetry
65+
publicIPAddressObject: {
66+
name: 'pip-${name}'
67+
zones:[]
68+
}
6569
}
6670
}
6771

infra/modules/network/jumpbox.bicep

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ param enableTelemetry bool = true
4040
module nsg 'br/public:avm/res/network/network-security-group:0.5.1' = if (!empty(subnet)) {
4141
name: '${vnetName}-${subnet.?networkSecurityGroup.name}'
4242
params: {
43-
name: '${vnetName}-${subnet.?networkSecurityGroup.name}'
43+
name: '${subnet.?networkSecurityGroup.name}-${vnetName}'
4444
location: location
4545
securityRules: subnet.?networkSecurityGroup.securityRules
4646
tags: tags
@@ -76,7 +76,7 @@ module vm 'br/public:avm/res/compute/virtual-machine:0.15.0' = {
7676
adminUsername: username
7777
adminPassword: password
7878
tags: tags
79-
zone: 2
79+
zone: 0
8080
imageReference: {
8181
offer: 'WindowsServer'
8282
publisher: 'MicrosoftWindowsServer'
@@ -86,13 +86,14 @@ module vm 'br/public:avm/res/compute/virtual-machine:0.15.0' = {
8686
osType: 'Windows'
8787
osDisk: {
8888
managedDisk: {
89+
name: 'osdisk-${vmName}'
8990
storageAccountType: 'Standard_LRS'
9091
}
9192
}
9293
encryptionAtHost: false // Some Azure subscriptions do not support encryption at host
9394
nicConfigurations: [
9495
{
95-
name: '${vmName}-nic'
96+
name: 'nic-${vmName}'
9697
ipConfigurations: [
9798
{
9899
name: 'ipconfig1'

infra/modules/network/main.bicep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ param tags object = {}
3030

3131
@description('Optional. Enable/Disable usage telemetry for module.')
3232
param enableTelemetry bool = true
33-
33+
3434
// /****************************************************************************************************************************/
3535
// Networking - NSGs, VNET and Subnets. Each subnet has its own NSG
3636
// /****************************************************************************************************************************/
@@ -55,7 +55,7 @@ module virtualNetwork 'virtualNetwork.bicep' = {
5555
module bastionHost 'bastionHost.bicep' = if (!empty(bastionConfiguration)) {
5656
name: '${resourcesName}-bastionHost'
5757
params: {
58-
name: bastionConfiguration.?name ?? 'bastion-${resourcesName}'
58+
name: bastionConfiguration.?name ?? 'bas-${resourcesName}'
5959
vnetId: virtualNetwork.outputs.resourceId
6060
vnetName: virtualNetwork.outputs.name
6161
location: location

infra/modules/network/virtualNetwork.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module nsgs 'br/public:avm/res/network/network-security-group:0.5.1' = [
3131
for (subnet, i) in subnets: if (!empty(subnet.?networkSecurityGroup)) {
3232
name: take('${name}-${subnet.?networkSecurityGroup.name}-networksecuritygroup', 64)
3333
params: {
34-
name: '${name}-${subnet.?networkSecurityGroup.name}'
34+
name: '${subnet.?networkSecurityGroup.name}-${name}'
3535
location: location
3636
securityRules: subnet.?networkSecurityGroup.securityRules
3737
tags: tags

infra/modules/storageAccount.bicep

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ module storageAccount 'br/public:avm/res/storage/storage-account:0.20.0' = {
103103
privateEndpoints: privateNetworking != null
104104
? [
105105
{
106+
name: 'pep-blob-${name}'
107+
customNetworkInterfaceName: 'nic-blob-${name}'
106108
privateDnsZoneGroup: {
107109
privateDnsZoneGroupConfigs: [
108110
{
@@ -114,6 +116,8 @@ module storageAccount 'br/public:avm/res/storage/storage-account:0.20.0' = {
114116
subnetResourceId: privateNetworking.?subnetResourceId ?? ''
115117
}
116118
{
119+
name: 'pep-file-${name}'
120+
customNetworkInterfaceName: 'nic-file-${name}'
117121
privateDnsZoneGroup: {
118122
privateDnsZoneGroupConfigs: [
119123
{

0 commit comments

Comments
 (0)