Skip to content

Commit 7d8b992

Browse files
added support for deploying local changes
1 parent e729a8d commit 7d8b992

File tree

4 files changed

+2030
-21
lines changed

4 files changed

+2030
-21
lines changed

azure.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: content-processing
55

66
requiredVersions:
77
azd: '>= 1.18.0 != 1.23.9'
8-
bicep: '>= 0.33.0'
8+
bicep: '>= 0.33.0'
99

1010
metadata:
1111
template: content-processing@1.0

azure_custom.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
2+
# Custom AZD configuration for Content Processing Solution Accelerator.
3+
# Use this file to build and deploy your own modified code using AZD.
4+
# This file works with infra/main_custom.bicep which uses placeholder container images
5+
# that AZD replaces with your custom-built images from source.
6+
#
7+
# Usage:
8+
# 1. Copy this file to azure.yaml (or rename it)
9+
# 2. Ensure infra/main_custom.bicep is referenced (rename to main.bicep or update infra path)
10+
# 3. Run: azd up
11+
#
12+
# For more information, see the Deployment Guide in docs/DeploymentGuide.md
13+
name: content-processing
14+
15+
requiredVersions:
16+
azd: '>= 1.18.0 != 1.23.9'
17+
18+
metadata:
19+
template: content-processing@1.0
20+
name: content-processing@1.0
21+
22+
# infra:
23+
# path: infra
24+
# module: main_custom
25+
26+
services:
27+
contentprocessor:
28+
project: ./src/ContentProcessor
29+
language: py
30+
host: containerapp
31+
docker:
32+
path: ./Dockerfile
33+
image: contentprocessor
34+
registry: ${AZURE_CONTAINER_REGISTRY_ENDPOINT}
35+
remoteBuild: true
36+
37+
contentprocessorapi:
38+
project: ./src/ContentProcessorAPI
39+
language: py
40+
host: containerapp
41+
docker:
42+
path: ./Dockerfile
43+
image: contentprocessorapi
44+
registry: ${AZURE_CONTAINER_REGISTRY_ENDPOINT}
45+
remoteBuild: true
46+
47+
contentprocessorweb:
48+
project: ./src/ContentProcessorWeb
49+
language: js
50+
host: containerapp
51+
docker:
52+
path: ./Dockerfile
53+
image: contentprocessorweb
54+
registry: ${AZURE_CONTAINER_REGISTRY_ENDPOINT}
55+
remoteBuild: true
56+
57+
contentprocessorworkflow:
58+
project: ./src/ContentProcessorWorkflow
59+
language: py
60+
host: containerapp
61+
docker:
62+
path: ./Dockerfile
63+
image: contentprocessorworkflow
64+
registry: ${AZURE_CONTAINER_REGISTRY_ENDPOINT}
65+
remoteBuild: true
66+
67+
hooks:
68+
postprovision:
69+
posix:
70+
shell: sh
71+
run: sed -i 's/\r$//' ./infra/scripts/post_deployment.sh; bash ./infra/scripts/post_deployment.sh
72+
interactive: true
73+
windows:
74+
shell: pwsh
75+
run: ./infra/scripts/post_deployment.ps1
76+
interactive: true

docs/DeploymentGuide.md

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -508,34 +508,29 @@ Now that your deployment is complete and tested, explore these resources:
508508
509509
---
510510
511-
## Advanced: Deploy Local Code Changes
511+
## Advanced: Deploy Local Changes
512512
513-
Use this method to quickly deploy code changes from your local machine to your existing Azure deployment without re-provisioning infrastructure.
513+
If you've made local modifications to the code and want to deploy them to Azure, follow these steps to swap the configuration files:
514514
515515
> **Note:** To set up and run the application locally for development, see the [Local Development Setup Guide](./LocalDevelopmentSetup.md).
516516
517-
### How it Works
518-
This process will:
519-
1. Rebuild the Docker containers locally using your modified source code.
520-
2. Push the new images to your Azure Container Registry (ACR).
521-
3. Restart the Azure Container Apps to pick up the new images.
517+
### Step 1: Rename Azure Configuration Files
522518
523-
### Prerequisites
524-
- **Docker Desktop** must be installed and running.
525-
- You must have an active deployment environment selected (`azd env select <env-name>`).
519+
**In the root directory:**
520+
1. Rename `azure.yaml` to `azure_custom2.yaml`
521+
2. Rename `azure_custom.yaml` to `azure.yaml`
526522
527-
### Deployment Steps
523+
### Step 2: Rename Infrastructure Files
528524
529-
Run the build and push script for your operating system:
525+
**In the `infra` directory:**
526+
1. Rename `main.bicep` to `main_custom2.bicep`
527+
2. Rename `main_custom.bicep` to `main.bicep`
530528
531-
**Linux/macOS:**
532-
```bash
533-
./infra/scripts/docker-build.sh
534-
```
529+
### Step 3: Deploy Changes
535530
536-
**Windows (PowerShell):**
537-
```powershell
538-
./infra/scripts/docker-build.ps1
531+
Run the deployment command:
532+
```shell
533+
azd up
539534
```
540535
541-
> **Note:** These scripts will deploy your local code changes instead of pulling from the GitHub repository.
536+
> **Note:** These custom files are configured to deploy your local code changes instead of pulling from the GitHub repository.

0 commit comments

Comments
 (0)