Skip to content
Merged
2 changes: 2 additions & 0 deletions .github/workflows/azure-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
- name: Validate Azure Template
uses: microsoft/template-validation-action@v0.4.3
id: validation
with:
useDevContainer: false
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
Expand Down
24 changes: 3 additions & 21 deletions azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,12 @@ metadata:
name: content-processinge@1.0

hooks:
postdeploy:
postprovision:
posix:
shell: sh
run: |
echo "🧭 Web App Details:"
echo "✅ Name: $CONTAINER_WEB_APP_NAME"
echo "🌐 Endpoint: https://$CONTAINER_WEB_APP_FQDN"
echo "🔗 Portal URL: https://portal.azure.com/#resource/subscriptions/$AZURE_SUBSCRIPTION_ID/resourceGroups/$AZURE_RESOURCE_GROUP/providers/Microsoft.App/containerApps/$CONTAINER_WEB_APP_NAME"

echo "🧭 API App Details:"
echo "✅ Name: $CONTAINER_API_APP_NAME"
echo "🌐 Endpoint: https://$CONTAINER_API_APP_FQDN"
echo "🔗 Portal URL: https://portal.azure.com/#resource/subscriptions/$AZURE_SUBSCRIPTION_ID/resourceGroups/$AZURE_RESOURCE_GROUP/providers/Microsoft.App/containerApps/$CONTAINER_API_APP_NAME"
run: sed -i 's/\r$//' ./infra/scripts/post_deployment.sh; bash ./infra/scripts/post_deployment.sh
interactive: true
windows:
shell: pwsh
run: |
Write-Host "🧭 Web App Details:"
Write-Host "✅ Name: $env:CONTAINER_WEB_APP_NAME"
Write-Host "🌐 Endpoint: https://$env:CONTAINER_WEB_APP_FQDN"
Write-Host "🔗 Portal URL: https://portal.azure.com/#resource/subscriptions/$env:AZURE_SUBSCRIPTION_ID/resourceGroups/$env:AZURE_RESOURCE_GROUP/providers/Microsoft.App/containerApps/$env:CONTAINER_WEB_APP_NAME" -ForegroundColor Cyan

Write-Host "🧭 API App Details:"
Write-Host "✅ Name: $env:CONTAINER_API_APP_NAME"
Write-Host "🌐 Endpoint: https://$env:CONTAINER_API_APP_FQDN"
Write-Host "🔗 Portal URL: https://portal.azure.com/#resource/subscriptions/$env:AZURE_SUBSCRIPTION_ID/resourceGroups/$env:AZURE_RESOURCE_GROUP/providers/Microsoft.App/containerApps/$env:CONTAINER_API_APP_NAME" -ForegroundColor Cyan
run: ./infra/scripts/post_deployment.ps1
interactive: true
9 changes: 6 additions & 3 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ param enableRedundancy bool = false
@description('Optional. Enable scalability for applicable resources, aligned with the Well Architected Framework recommendations. Defaults to false.')
param enableScalability bool = false

@description('Optional. Enable purge protection. Defaults to false.')
param enablePurgeProtection bool = false

@description('Optional. Tags to be applied to the resources.')
param tags resourceInput<'Microsoft.Resources/resourceGroups@2025-04-01'>.tags = {
app: 'Content Processing Solution Accelerator'
Expand Down Expand Up @@ -987,7 +990,7 @@ module avmAppConfig 'br/public:avm/res/app-configuration/configuration-store:0.6
params: {
name: 'appcs-${solutionSuffix}'
location: resourceGroupLocation
enablePurgeProtection: false
enablePurgeProtection: enablePurgeProtection
tags: {
app: solutionSuffix
location: resourceGroupLocation
Expand Down Expand Up @@ -1100,7 +1103,7 @@ module avmAppConfig 'br/public:avm/res/app-configuration/configuration-store:0.6
}
{
name: 'APP_AI_PROJECT_ENDPOINT'
value: avmAiServices.outputs.aiProjectInfo.apiEndpoint
value: avmAiServices.outputs.aiProjectInfo.?apiEndpoint ?? ''
}
{
name: 'APP_COSMOS_CONNSTR'
Expand Down Expand Up @@ -1367,4 +1370,4 @@ output CONTAINER_REGISTRY_NAME string = avmContainerRegistry.outputs.name
output CONTAINER_REGISTRY_LOGIN_SERVER string = avmContainerRegistry.outputs.loginServer

@description('The resource group the resources were deployed into.')
output resourceGroupName string = resourceGroup().name
output AZURE_RESOURCE_GROUP string = resourceGroup().name
21 changes: 14 additions & 7 deletions infra/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.37.4.10188",
"templateHash": "6682056177373814634"
"templateHash": "10045374231657176554"
},
"name": "Content Processing Solution Accelerator",
"description": "Bicep template to deploy the Content Processing Solution Accelerator with AVM compliance."
Expand Down Expand Up @@ -154,6 +154,13 @@
"description": "Optional. Enable scalability for applicable resources, aligned with the Well Architected Framework recommendations. Defaults to false."
}
},
"enablePurgeProtection": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Optional. Enable purge protection. Defaults to false."
}
},
"tags": {
"type": "object",
"metadata": {
Expand Down Expand Up @@ -38703,10 +38710,10 @@
"dependsOn": [
"avmContainerApp",
"avmManagedIdentity",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').contentUnderstanding)]",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)]",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)]",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)]",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)]",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').contentUnderstanding)]",
"logAnalyticsWorkspace",
"virtualNetwork"
]
Expand Down Expand Up @@ -41044,8 +41051,8 @@
"dependsOn": [
"avmContainerApp",
"avmManagedIdentity",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').contentUnderstanding)]",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)]",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').contentUnderstanding)]",
"virtualNetwork"
]
},
Expand Down Expand Up @@ -50941,7 +50948,7 @@
"value": "[parameters('resourceGroupLocation')]"
},
"enablePurgeProtection": {
"value": false
"value": "[parameters('enablePurgeProtection')]"
},
"tags": {
"value": {
Expand Down Expand Up @@ -51060,7 +51067,7 @@
},
{
"name": "APP_AI_PROJECT_ENDPOINT",
"value": "[reference('avmAiServices').outputs.aiProjectInfo.value.apiEndpoint]"
"value": "[coalesce(tryGet(reference('avmAiServices').outputs.aiProjectInfo.value, 'apiEndpoint'), '')]"
},
{
"name": "APP_COSMOS_CONNSTR",
Expand Down Expand Up @@ -58237,7 +58244,7 @@
},
"value": "[reference('avmContainerRegistry').outputs.loginServer.value]"
},
"resourceGroupName": {
"AZURE_RESOURCE_GROUP": {
"type": "string",
"metadata": {
"description": "The resource group the resources were deployed into."
Expand Down
2 changes: 0 additions & 2 deletions infra/scripts/post_deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ set -e

echo "🔍 Fetching container app info from azd environment..."

echo "Started at: $(date)"

# Load values from azd env
CONTAINER_WEB_APP_NAME=$(azd env get-value CONTAINER_WEB_APP_NAME)
CONTAINER_WEB_APP_FQDN=$(azd env get-value CONTAINER_WEB_APP_FQDN)
Expand Down
Loading