-
Notifications
You must be signed in to change notification settings - Fork 170
Expand file tree
/
Copy pathazure.yaml
More file actions
152 lines (136 loc) · 5.6 KB
/
azure.yaml
File metadata and controls
152 lines (136 loc) · 5.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
environment:
name: content-generation
location: eastus
name: content-generation
metadata:
template: content-generation@1.22
requiredVersions:
azd: '>= 1.18.0'
parameters:
solutionPrefix:
type: string
default: contentgen
displayName: Solution Prefix
description: A unique prefix for all resources (3-15 chars)
azureAiServiceLocation:
type: string
default: eastus
displayName: AI Services Location
description: Location for Azure AI Services deployments
enableMonitoring:
type: boolean
default: false
displayName: Enable Monitoring (WAF)
description: Enable Log Analytics and Application Insights
enableScalability:
type: boolean
default: false
displayName: Enable Scalability (WAF)
description: Enable auto-scaling and higher SKUs
enableRedundancy:
type: boolean
default: false
displayName: Enable Redundancy (WAF)
description: Enable zone redundancy and geo-replication
enablePrivateNetworking:
type: boolean
default: false
displayName: Enable Private Networking (WAF)
description: Enable VNet integration and private endpoints
infra:
provider: bicep
path: ./infra
module: main
workflows:
up:
steps:
- azd: provision
hooks:
postprovision:
windows:
run: |
Write-Host "===== Provision Complete =====" -ForegroundColor Green
Write-Host ""
Write-Host "Web App URL: " -NoNewline
Write-Host "$env:WEB_APP_URL" -ForegroundColor Cyan
Write-Host "Storage Account: " -NoNewline
Write-Host "$env:AZURE_BLOB_ACCOUNT_NAME" -ForegroundColor Cyan
Write-Host "AI Search Service: " -NoNewline
Write-Host "$env:AI_SEARCH_SERVICE_NAME" -ForegroundColor Cyan
Write-Host "AI Search Index: " -NoNewline
Write-Host "$env:AZURE_AI_SEARCH_PRODUCTS_INDEX" -ForegroundColor Cyan
Write-Host "AI Service Location: " -NoNewline
Write-Host "$env:AZURE_ENV_OPENAI_LOCATION" -ForegroundColor Cyan
Write-Host "Container Instance: " -NoNewline
Write-Host "$env:CONTAINER_INSTANCE_NAME" -ForegroundColor Cyan
# Run post-deploy script to upload sample data and create search index
Write-Host ""
# Note: Cosmos DB role is assigned to deployer via Bicep.
Write-Host "===== Running Post-Deploy Script =====" -ForegroundColor Yellow
Write-Host "This will upload sample data and create the search index..."
# Ensure post-deploy Python dependencies are installed
$python = "python"
if (Test-Path "./.venv/Scripts/python.exe") { $python = "./.venv/Scripts/python.exe" }
elseif (Test-Path "../.venv/Scripts/python.exe") { $python = "../.venv/Scripts/python.exe" }
elseif (Test-Path "./.venv/bin/python") { $python = "./.venv/bin/python" }
elseif (Test-Path "../.venv/bin/python") { $python = "../.venv/bin/python" }
& $python -m pip install -r ./scripts/requirements-post-deploy.txt --quiet | Out-Null
if (Test-Path "./scripts/post_deploy.py") {
& $python ./scripts/post_deploy.py --skip-tests
if ($LASTEXITCODE -eq 0) {
Write-Host "Post-deploy script completed successfully!" -ForegroundColor Green
} else {
Write-Host "Post-deploy script completed with warnings (some steps may have failed)" -ForegroundColor Yellow
}
} else {
Write-Host "Warning: post_deploy.py not found, skipping sample data upload" -ForegroundColor Yellow
}
Write-Host ""
Write-Host "===== Deployment Complete =====" -ForegroundColor Green
Write-Host ""
Write-Host "Access the web application:"
Write-Host " $env:WEB_APP_URL" -ForegroundColor Cyan
shell: pwsh
continueOnError: false
interactive: true
posix:
run: |
echo "===== Provision Complete ====="
echo ""
echo "Web App URL: $WEB_APP_URL"
echo "Storage Account: $AZURE_BLOB_ACCOUNT_NAME"
echo "AI Search Service: $AI_SEARCH_SERVICE_NAME"
echo "AI Search Index: $AZURE_AI_SEARCH_PRODUCTS_INDEX"
echo "AI Service Location: $AZURE_ENV_OPENAI_LOCATION"
echo "Container Instance: $CONTAINER_INSTANCE_NAME"
echo ""
echo "Container Registry: $ACR_NAME"
# Run post-deploy script to upload sample data and create search index
echo ""
# Note: Cosmos DB role is assigned to deployer via Bicep.
echo "===== Running Post-Deploy Script ====="
echo "This will upload sample data and create the search index..."
if [ -f "./scripts/post_deploy.py" ]; then
# Prefer local venv if present (repo root or content-gen)
if [ -x "./.venv/bin/python" ]; then
PYTHON_BIN="./.venv/bin/python"
elif [ -x "../.venv/bin/python" ]; then
PYTHON_BIN="../.venv/bin/python"
else
PYTHON_BIN="python3"
fi
"$PYTHON_BIN" -m pip install -r ./scripts/requirements-post-deploy.txt --quiet > /dev/null \
&& "$PYTHON_BIN" ./scripts/post_deploy.py --skip-tests \
&& echo "Post-deploy script completed successfully!" \
|| echo "Post-deploy script completed with warnings (some steps may have failed)"
else
echo "Warning: post_deploy.py not found, skipping sample data upload"
fi
echo ""
echo "===== Deployment Complete ====="
echo ""
echo "Access the web application:"
echo " $WEB_APP_URL"
shell: sh
continueOnError: false
interactive: true