@@ -2,9 +2,9 @@ environment:
22 name : content-generation
33 location : eastus
44
5- # name: content-generation
6- # metadata:
7- # template: content-generation@1.22
5+ name : content-generation
6+ metadata :
7+ template : content-generation@1.22
88
99requiredVersions :
1010 azd : ' >= 1.18.0'
@@ -46,10 +46,6 @@ infra:
4646 path : ./infra
4747 module : main
4848
49- # Custom workflow:
50- # 1. First provision creates infrastructure (skips ACI for private networking)
51- # 2. Build container image to ACR
52- # 3. Second provision creates ACI with the now-available image
5349workflows :
5450 up :
5551 steps :
@@ -120,47 +116,6 @@ hooks:
120116 Write-Host " Cosmos DB role may already be assigned" -ForegroundColor Yellow
121117 }
122118
123- # ============================================================
124- # ACR Image Build - COMMENTED OUT
125- # Images should be pre-built and pushed to ACR before deployment:
126- # Frontend (App Service): content-gen-webapp:latest
127- # Backend (ACI): content-gen-api:latest
128- #
129- # To build and push manually:
130- # az acr build --registry $ACR_NAME --image content-gen-webapp:latest --file ./src/Frontend.Dockerfile ./src
131- # az acr build --registry $ACR_NAME --image content-gen-api:latest --file ./src/backend/ApiApp.Dockerfile ./src
132- # ============================================================
133-
134- # # Build container image and deploy ACI if ACR exists and ACI was skipped
135- # $skipContainer = azd env get-value skipContainerDeployment 2>$null
136- # if ($env:ACR_NAME -and $skipContainer -eq 'true') {
137- # Write-Host ""
138- # Write-Host "===== Building Container Image =====" -ForegroundColor Yellow
139- # Write-Host "Building and pushing image to ACR: $env:ACR_NAME" -ForegroundColor Cyan
140- #
141- # az acr build --registry $env:ACR_NAME --image content-gen-api:latest --file ./src/backend/ApiApp.Dockerfile ./src
142- #
143- # if ($LASTEXITCODE -eq 0) {
144- # Write-Host "Container image built and pushed successfully!" -ForegroundColor Green
145- #
146- # # Enable container deployment and re-provision
147- # Write-Host ""
148- # Write-Host "===== Deploying Container Instance =====" -ForegroundColor Yellow
149- # azd env set skipContainerDeployment false
150- #
151- # Write-Host "Re-running provision to deploy ACI..." -ForegroundColor Cyan
152- # azd provision --no-prompt
153- #
154- # if ($LASTEXITCODE -eq 0) {
155- # Write-Host "Container Instance deployed successfully!" -ForegroundColor Green
156- # } else {
157- # Write-Host "Container Instance deployment failed" -ForegroundColor Red
158- # }
159- # } else {
160- # Write-Host "Failed to build container image" -ForegroundColor Red
161- # }
162- # }
163-
164119 if ($env:CONTAINER_INSTANCE_NAME) {
165120 Write-Host ""
166121 Write-Host "Container Instance: " -NoNewline
@@ -169,48 +124,6 @@ hooks:
169124 Write-Host "$env:CONTAINER_INSTANCE_PRIVATE_IP" -ForegroundColor Cyan
170125 }
171126
172- Write-Host ""
173- Write-Host "Container Registry: " -NoNewline
174- Write-Host "$env:ACR_NAME" -ForegroundColor Cyan
175-
176- # ============================================================
177- # Frontend Build/Deploy - COMMENTED OUT (using pre-built ACR image)
178- # ============================================================
179- # # Build and deploy frontend to App Service
180- # Write-Host ""
181- # Write-Host "===== Building Frontend =====" -ForegroundColor Yellow
182- # Push-Location ./src/frontend
183- # npm install
184- # npm run build
185- #
186- # if ($LASTEXITCODE -eq 0) {
187- # Write-Host "Frontend build completed!" -ForegroundColor Green
188- #
189- # # Copy build to frontend-server
190- # Copy-Item -Path ../static/* -Destination ../frontend-server/static/ -Recurse -Force -ErrorAction SilentlyContinue
191- #
192- # Push-Location ../frontend-server
193- #
194- # # Create deployment package
195- # Write-Host "Creating deployment package..."
196- # Remove-Item -Path frontend-deploy.zip -Force -ErrorAction SilentlyContinue
197- # Compress-Archive -Path static, server.js, package.json, package-lock.json -DestinationPath frontend-deploy.zip -Force
198- #
199- # Write-Host ""
200- # Write-Host "===== Deploying Frontend to App Service =====" -ForegroundColor Yellow
201- # az webapp deploy --resource-group $env:RESOURCE_GROUP_NAME --name $env:APP_SERVICE_NAME --src-path frontend-deploy.zip --type zip
202- #
203- # if ($LASTEXITCODE -eq 0) {
204- # Write-Host "Frontend deployed successfully!" -ForegroundColor Green
205- # } else {
206- # Write-Host "Frontend deployment failed" -ForegroundColor Red
207- # }
208- #
209- # Pop-Location
210- # } else {
211- # Write-Host "Frontend build failed" -ForegroundColor Red
212- # }
213- # Pop-Location
214127
215128 # Run post-deploy script to upload sample data and create search index
216129 Write-Host ""
@@ -272,43 +185,6 @@ hooks:
272185 --principal-id "$signed_user_id" \
273186 --scope "/" 2>/dev/null && echo " Cosmos DB role assigned successfully" || echo " Cosmos DB role may already be assigned"
274187
275- # ============================================================
276- # ACR Image Build - COMMENTED OUT
277- # Images should be pre-built and pushed to ACR before deployment:
278- # Frontend (App Service): content-gen-webapp:latest
279- # Backend (ACI): content-gen-api:latest
280- #
281- # To build and push manually:
282- # az acr build --registry $ACR_NAME --image content-gen-webapp:latest --file ./src/Frontend.Dockerfile ./src
283- # az acr build --registry $ACR_NAME --image content-gen-api:latest --file ./src/backend/ApiApp.Dockerfile ./src
284- # ============================================================
285-
286- # # Build container image and deploy ACI if ACR exists and ACI was skipped
287- # skip_container=$(azd env get-value skipContainerDeployment 2>/dev/null || echo "")
288- # if [ -n "$ACR_NAME" ] && [ "$skip_container" = "true" ]; then
289- # echo ""
290- # echo "===== Building Container Image ====="
291- # echo "Building and pushing image to ACR: $ACR_NAME"
292- #
293- # if az acr build --registry "$ACR_NAME" --image content-gen-api:latest --file ./src/backend/ApiApp.Dockerfile ./src; then
294- # echo "Container image built and pushed successfully!"
295- #
296- # # Enable container deployment and re-provision
297- # echo ""
298- # echo "===== Deploying Container Instance ====="
299- # azd env set skipContainerDeployment false
300- #
301- # echo "Re-running provision to deploy ACI..."
302- # if azd provision --no-prompt; then
303- # echo "Container Instance deployed successfully!"
304- # else
305- # echo "Container Instance deployment failed"
306- # fi
307- # else
308- # echo "Failed to build container image"
309- # fi
310- # fi
311-
312188 if [ -n "$CONTAINER_INSTANCE_NAME" ]; then
313189 echo ""
314190 echo "Container Instance: $CONTAINER_INSTANCE_NAME"
@@ -318,44 +194,6 @@ hooks:
318194 echo ""
319195 echo "Container Registry: $ACR_NAME"
320196
321- # ============================================================
322- # Frontend Build/Deploy - COMMENTED OUT (using pre-built ACR image)
323- # ============================================================
324- # # Build and deploy frontend to App Service
325- # echo ""
326- # echo "===== Building Frontend ====="
327- # cd ./src/frontend
328- # if npm install && npm run build; then
329- # echo "Frontend build completed!"
330- #
331- # # Copy build to frontend-server
332- # cp -r ../static/* ../frontend-server/static/ 2>/dev/null || true
333- #
334- # cd ../frontend-server
335- #
336- # # Create deployment package
337- # echo "Creating deployment package..."
338- # rm -f frontend-deploy.zip
339- # zip -r frontend-deploy.zip static/ server.js package.json package-lock.json
340- #
341- # echo ""
342- # echo "===== Deploying Frontend to App Service ====="
343- # if az webapp deploy \
344- # --resource-group "$RESOURCE_GROUP_NAME" \
345- # --name "$APP_SERVICE_NAME" \
346- # --src-path frontend-deploy.zip \
347- # --type zip; then
348- # echo "Frontend deployed successfully!"
349- # else
350- # echo "Frontend deployment failed"
351- # fi
352- #
353- # cd ../..
354- # else
355- # echo "Frontend build failed"
356- # cd ../..
357- # fi
358-
359197 # Run post-deploy script to upload sample data and create search index
360198 echo ""
361199 echo "===== Running Post-Deploy Script ====="
0 commit comments