Skip to content

refactor: update naming conventions for resources in Bicep files #368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,20 @@ deployment:
solutionPrefix: ${parameters.solutionPrefix}
otherLocation: ${parameters.otherLocation}
baseUrl: ${parameters.baseUrl}

hooks:
postprovision:
windows:
run: |
Write-Host "Web app URL: "
Write-Host "$env:WEB_APP_URL" -ForegroundColor Cyan
shell: pwsh
continueOnError: false
interactive: true
posix:
run: |
echo "Web app URL: "
echo $WEB_APP_URL
shell: sh
continueOnError: false
interactive: true
18 changes: 9 additions & 9 deletions infra/deploy_ai_foundry.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ param embeddingModel string
param embeddingDeploymentCapacity int
param managedIdentityObjectId string

var storageName = '${solutionName}hubstorage'
var storageName = 'st${solutionName}hub'
var storageSkuName = 'Standard_LRS'
var aiServicesName = '${solutionName}-aiservices'
var aiServicesName = 'ais-${solutionName}'
// var aiServicesName_m = '${solutionName}-aiservices_m'
// var location_m = solutionLocation
var applicationInsightsName = '${solutionName}-appinsights'
var containerRegistryName = '${solutionName}acr'
var keyvaultName = '${solutionName}-kv'
var applicationInsightsName = 'appi-${solutionName}'
var containerRegistryName = 'cr-${solutionName}'
var keyvaultName = 'kv-${solutionName}'
var location = solutionLocation //'eastus2'
var aiHubName = '${solutionName}-aihub'
var aiHubName = 'hub-${solutionName}'
var aiHubFriendlyName = aiHubName
var aiHubDescription = 'AI Hub'
var aiProjectName = '${solutionName}-aiproject'
var aiProjectName = 'proj-${solutionName}'
var aiProjectFriendlyName = aiProjectName
var aiSearchName = '${solutionName}-search'
var workspaceName = '${solutionName}-workspace'
var aiSearchName = 'srch-${solutionName}'
var workspaceName = 'log-${solutionName}-hub'
var aiModelDeployments = [
{
name: gptModelName
Expand Down
6 changes: 3 additions & 3 deletions infra/deploy_app_service.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ param solutionName string
// param identity string

@description('Name of App Service plan')
param HostingPlanName string = '${ solutionName }-app-service-plan'
param HostingPlanName string = 'asp-${ solutionName }'

@description('The pricing tier for the App Service plan')
@allowed(
['F1', 'D1', 'B1', 'B2', 'B3', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4','P0v3']
)
// param HostingPlanSku string = 'B1'

param HostingPlanSku string = 'P0v3'
param HostingPlanSku string = 'B1'

@description('Name of Web App')
param WebsiteName string = '${ solutionName }-app-service'
param WebsiteName string = 'app-${ solutionName }'

// @description('Name of Application Insights')
// param ApplicationInsightsName string = '${ solutionName }-app-insights'
Expand Down
2 changes: 1 addition & 1 deletion infra/deploy_cosmos_db.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ param solutionName string
param solutionLocation string
param keyVaultName string

var accountName = '${ solutionName }-cosmos'
var accountName = 'cosmos-${ solutionName }'
var databaseName = 'db_conversation_history'
var collectionName = 'conversations'

Expand Down
2 changes: 1 addition & 1 deletion infra/deploy_keyvault.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ param solutionName string
param solutionLocation string
param managedIdentityObjectId string

var keyvaultName = '${solutionName}-kv'
var keyvaultName = 'kv-${solutionName}'

resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = {
name: keyvaultName
Expand Down
2 changes: 1 addition & 1 deletion infra/deploy_managed_identity.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ param solutionName string
param solutionLocation string

@description('Name')
param miName string = '${ solutionName }-managed-identity'
param miName string = 'id-${ solutionName }'

resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
name: miName
Expand Down
4 changes: 2 additions & 2 deletions infra/deploy_post_deployment_scripts.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ param managedIdentityObjectId string
param managedIdentityClientId string
param storageAccountName string
param containerName string
param containerAppName string = '${ solutionName }containerapp'
param environmentName string = '${ solutionName }containerappenv'
param containerAppName string = 'ca-${ solutionName }'
param environmentName string = 'cae-${ solutionName }'
param imageName string = 'python:3.11-alpine'
param setupCopyKbFiles string = '${baseUrl}infra/scripts/copy_kb_files.sh'
param setupCreateIndexScriptsUrl string = '${baseUrl}infra/scripts/run_create_index_scripts.sh'
Expand Down
2 changes: 1 addition & 1 deletion infra/deploy_storage_account.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ param solutionName string
param solutionLocation string

@description('Name')
param saName string = '${ solutionName }storage'
param saName string = 'st${ solutionName }'

param keyVaultName string
param managedIdentityObjectId string
Expand Down
4 changes: 2 additions & 2 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ var resourceGroupLocation = resourceGroup().location
var solutionLocation = resourceGroupLocation
var baseUrl = 'https://raw.githubusercontent.com/microsoft/document-generation-solution-accelerator/main/'

var ApplicationInsightsName = 'appins-${solutionPrefix}'
var WorkspaceName = 'worksp-${solutionPrefix}'
var ApplicationInsightsName = 'appi-${solutionPrefix}'
var WorkspaceName = 'log-${solutionPrefix}'

// ========== Managed Identity ========== //
module managedIdentityModule 'deploy_managed_identity.bicep' = {
Expand Down
72 changes: 36 additions & 36 deletions infra/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.34.1.11899",
"templateHash": "10534846592360054965"
"version": "0.34.44.8038",
"templateHash": "745056846550767942"
}
},
"parameters": {
Expand Down Expand Up @@ -93,8 +93,8 @@
"resourceGroupLocation": "[resourceGroup().location]",
"solutionLocation": "[variables('resourceGroupLocation')]",
"baseUrl": "https://raw.githubusercontent.com/microsoft/document-generation-solution-accelerator/main/",
"ApplicationInsightsName": "[format('appins-{0}', variables('solutionPrefix'))]",
"WorkspaceName": "[format('worksp-{0}', variables('solutionPrefix'))]"
"ApplicationInsightsName": "[format('appi-{0}', variables('solutionPrefix'))]",
"WorkspaceName": "[format('log-{0}', variables('solutionPrefix'))]"
},
"resources": [
{
Expand Down Expand Up @@ -150,8 +150,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.34.1.11899",
"templateHash": "5321954130579291970"
"version": "0.34.44.8038",
"templateHash": "16854919160820907978"
}
},
"parameters": {
Expand All @@ -171,7 +171,7 @@
},
"miName": {
"type": "string",
"defaultValue": "[format('{0}-managed-identity', parameters('solutionName'))]",
"defaultValue": "[format('id-{0}', parameters('solutionName'))]",
"metadata": {
"description": "Name"
}
Expand Down Expand Up @@ -243,8 +243,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.34.1.11899",
"templateHash": "15644309813710584263"
"version": "0.34.44.8038",
"templateHash": "998804936838864872"
}
},
"parameters": {
Expand All @@ -264,7 +264,7 @@
}
},
"variables": {
"keyvaultName": "[format('{0}-kv', parameters('solutionName'))]"
"keyvaultName": "[format('kv-{0}', parameters('solutionName'))]"
},
"resources": [
{
Expand Down Expand Up @@ -383,8 +383,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.34.1.11899",
"templateHash": "6241332452423283350"
"version": "0.34.44.8038",
"templateHash": "15569997416548251984"
}
},
"parameters": {
Expand Down Expand Up @@ -420,20 +420,20 @@
}
},
"variables": {
"storageName": "[format('{0}hubstorage', parameters('solutionName'))]",
"storageName": "[format('st{0}hub', parameters('solutionName'))]",
"storageSkuName": "Standard_LRS",
"aiServicesName": "[format('{0}-aiservices', parameters('solutionName'))]",
"applicationInsightsName": "[format('{0}-appinsights', parameters('solutionName'))]",
"containerRegistryName": "[format('{0}acr', parameters('solutionName'))]",
"keyvaultName": "[format('{0}-kv', parameters('solutionName'))]",
"aiServicesName": "[format('ais-{0}', parameters('solutionName'))]",
"applicationInsightsName": "[format('appi-{0}', parameters('solutionName'))]",
"containerRegistryName": "[format('cr-{0}', parameters('solutionName'))]",
"keyvaultName": "[format('kv-{0}', parameters('solutionName'))]",
"location": "[parameters('solutionLocation')]",
"aiHubName": "[format('{0}-aihub', parameters('solutionName'))]",
"aiHubName": "[format('hub-{0}', parameters('solutionName'))]",
"aiHubFriendlyName": "[variables('aiHubName')]",
"aiHubDescription": "AI Hub",
"aiProjectName": "[format('{0}-aiproject', parameters('solutionName'))]",
"aiProjectName": "[format('proj-{0}', parameters('solutionName'))]",
"aiProjectFriendlyName": "[variables('aiProjectName')]",
"aiSearchName": "[format('{0}-search', parameters('solutionName'))]",
"workspaceName": "[format('{0}-workspace', parameters('solutionName'))]",
"aiSearchName": "[format('srch-{0}', parameters('solutionName'))]",
"workspaceName": "[format('log-{0}-hub', parameters('solutionName'))]",
"aiModelDeployments": [
{
"name": "[parameters('gptModelName')]",
Expand Down Expand Up @@ -981,8 +981,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.34.1.11899",
"templateHash": "5169332991642386736"
"version": "0.34.44.8038",
"templateHash": "4051638923493896337"
}
},
"parameters": {
Expand All @@ -1002,7 +1002,7 @@
},
"saName": {
"type": "string",
"defaultValue": "[format('{0}storage', parameters('solutionName'))]",
"defaultValue": "[format('st{0}', parameters('solutionName'))]",
"metadata": {
"description": "Name"
}
Expand Down Expand Up @@ -1210,8 +1210,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.34.1.11899",
"templateHash": "12565043404933150402"
"version": "0.34.44.8038",
"templateHash": "4077975888118623954"
}
},
"parameters": {
Expand All @@ -1225,14 +1225,14 @@
},
"HostingPlanName": {
"type": "string",
"defaultValue": "[format('{0}-app-service-plan', parameters('solutionName'))]",
"defaultValue": "[format('asp-{0}', parameters('solutionName'))]",
"metadata": {
"description": "Name of App Service plan"
}
},
"HostingPlanSku": {
"type": "string",
"defaultValue": "P0v3",
"defaultValue": "B1",
"allowedValues": [
"F1",
"D1",
Expand All @@ -1254,7 +1254,7 @@
},
"WebsiteName": {
"type": "string",
"defaultValue": "[format('{0}-app-service', parameters('solutionName'))]",
"defaultValue": "[format('app-{0}', parameters('solutionName'))]",
"metadata": {
"description": "Name of Web App"
}
Expand Down Expand Up @@ -1696,8 +1696,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.34.1.11899",
"templateHash": "11157199356947505887"
"version": "0.34.44.8038",
"templateHash": "6611317231290784098"
}
},
"parameters": {
Expand Down Expand Up @@ -1730,7 +1730,7 @@
}
},
"variables": {
"accountName": "[format('{0}-cosmos', parameters('solutionName'))]",
"accountName": "[format('cosmos-{0}', parameters('solutionName'))]",
"databaseName": "db_conversation_history",
"collectionName": "conversations",
"containers": [
Expand Down Expand Up @@ -1919,8 +1919,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.34.1.11899",
"templateHash": "16100001477502640669"
"version": "0.34.44.8038",
"templateHash": "17578272684671627358"
}
},
"parameters": {
Expand Down Expand Up @@ -1953,11 +1953,11 @@
},
"containerAppName": {
"type": "string",
"defaultValue": "[format('{0}containerapp', parameters('solutionName'))]"
"defaultValue": "[format('ca-{0}', parameters('solutionName'))]"
},
"environmentName": {
"type": "string",
"defaultValue": "[format('{0}containerappenv', parameters('solutionName'))]"
"defaultValue": "[format('cae-{0}', parameters('solutionName'))]"
},
"imageName": {
"type": "string",
Expand Down
Loading