Skip to content
Merged
10 changes: 10 additions & 0 deletions .github/workflows/deploy-waf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ jobs:
echo "Resource group already exists."
fi

- name: Generate Unique Solution Prefix
id: generate_solution_prefix
run: |
COMMON_PART="macae"
TIMESTAMP=$(date +%s)
UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 6)
UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}"
echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV

- name: Deploy Bicep Template
id: deploy
run: |
Expand All @@ -100,6 +109,7 @@ jobs:
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
--template-file infra/main.bicep \
--parameters \
environmentName=${{ env.SOLUTION_PREFIX }} \
useWafAlignedArchitecture=true \
aiDeploymentsLocation='${{ env.AZURE_LOCATION }}' \
gptModelCapacity=5 \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
--template-file infra/main.bicep \
--parameters \
solutionPrefix=${{ env.SOLUTION_PREFIX }} \
environmentName=${{ env.SOLUTION_PREFIX }} \
solutionLocation="${{ env.AZURE_LOCATION }}" \
modelDeploymentType="GlobalStandard" \
gptModelName="gpt-4o" \
Expand Down
10 changes: 6 additions & 4 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ param useWafAlignedArchitecture bool
@description('Use this parameter to use an existing AI project resource ID')
param existingFoundryProjectResourceId string = ''

@description('Optional. The prefix to add in the default names given to all deployed Azure resources.')
@maxLength(19)
param solutionPrefix string = 'macae${uniqueString(deployer().objectId, deployer().tenantId, subscription().subscriptionId, resourceGroup().id)}'
@description('Required. Name of the environment to deploy the solution into.')
param environmentName string

@description('Required. Location for all Resources except AI Foundry.')
param solutionLocation string = resourceGroup().location
Expand Down Expand Up @@ -48,6 +47,8 @@ param gptModelCapacity int = 150
@description('Set the image tag for the container images used in the solution. Default is "latest".')
param imageTag string = 'latest'

param solutionPrefix string = 'macae-${padLeft(take(toLower(uniqueString(subscription().id, environmentName, resourceGroup().location)), 12), 12, '0')}'

@description('Optional. The tags to apply to all deployed Azure resources.')
param tags object = {
app: solutionPrefix
Expand Down Expand Up @@ -616,6 +617,7 @@ module bastionHost 'br/public:avm/res/network/bastion-host:0.6.1' = if (virtualN
virtualNetworkResourceId: bastionConfiguration.?virtualNetworkResourceId ?? virtualNetwork.?outputs.?resourceId
publicIPAddressObject: {
name: bastionConfiguration.?publicIpResourceName ?? 'pip-bas${solutionPrefix}'
zones: []
}
disableCopyPaste: false
enableFileCopy: false
Expand Down Expand Up @@ -662,7 +664,7 @@ module virtualMachine 'br/public:avm/res/compute/virtual-machine:0.13.0' = if (v
name: 'osdisk-${virtualMachineResourceName}'
createOption: 'FromImage'
managedDisk: {
storageAccountType: 'Premium_ZRS'
storageAccountType: 'Standard_LRS'
}
diskSizeGB: 128
caching: 'ReadWrite'
Expand Down
2 changes: 1 addition & 1 deletion infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
]
},
"solutionPrefix": {
"environmentName": {
"value": "${AZURE_ENV_NAME}"
},
"solutionLocation": {
Expand Down
Loading