Skip to content

Commit a5d6a5c

Browse files
merge: integrate psl-uitemplatechng into psl-ui-refractoring (folder restructure)
2 parents 10ede7e + 3d05925 commit a5d6a5c

100 files changed

Lines changed: 1868 additions & 1330 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.sample

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ USE_FOUNDRY=false
1717
AZURE_AI_PROJECT_ENDPOINT=
1818

1919
# Image model deployment name in Foundry (e.g., gpt-image-1-mini)
20-
AZURE_AI_IMAGE_DEPLOYMENT=gpt-image-1-mini
20+
AZURE_AI_IMAGE_MODEL_DEPLOYMENT=gpt-image-1-mini
2121

2222
# =============================================================================
2323
# Azure OpenAI Configuration
@@ -113,3 +113,13 @@ WORKERS=4
113113
# Feature flags
114114
AUTH_ENABLED=false
115115
SANITIZE_ANSWER=false
116+
117+
# =============================================================================
118+
# Logging Configuration
119+
# =============================================================================
120+
# Basic logging level (DEBUG, INFO, WARNING, ERROR)
121+
AZURE_BASIC_LOGGING_LEVEL=INFO
122+
# Logging level for Azure SDK and third-party packages (DEBUG, INFO, WARNING, ERROR)
123+
AZURE_PACKAGE_LOGGING_LEVEL=WARNING
124+
# Comma-separated list of Python logger names to apply package logging level to
125+
AZURE_LOGGING_PACKAGES=

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ updates:
3535
# npm dependencies - grouped
3636
- package-ecosystem: "npm"
3737
directories:
38-
- "/src/app/frontend"
39-
- "/src/app/frontend-server"
38+
- "/src/app"
39+
- "/src/app/server"
4040
schedule:
4141
interval: "monthly"
4242
target-branch: "dependabotchanges"

.github/workflows/docker-build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
- demo
99
paths:
1010
- 'src/backend/**'
11-
- 'src/app/frontend/**'
12-
- 'src/app/frontend-server/**'
11+
- 'src/app/**'
12+
- 'src/app/server/**'
1313
- '.github/workflows/docker-build.yml'
1414
pull_request:
1515
types:
@@ -23,8 +23,8 @@ on:
2323
- demo
2424
paths:
2525
- 'src/backend/**'
26-
- 'src/app/frontend/**'
27-
- 'src/app/frontend-server/**'
26+
- 'src/app/**'
27+
- 'src/app/server/**'
2828
- '.github/workflows/docker-build.yml'
2929
workflow_dispatch:
3030

.github/workflows/job-deploy.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,12 +339,14 @@ jobs:
339339
AZURE_REGIONS: ${{ vars.AZURE_REGIONS }}
340340
run: |
341341
chmod +x scripts/checkquota.sh
342-
if ! scripts/checkquota.sh; then
342+
QUOTA_OUTPUT="$(scripts/checkquota.sh 2>&1)"; QUOTA_STATUS=$?
343+
echo "$QUOTA_OUTPUT"
344+
if [ "$QUOTA_STATUS" -ne 0 ]; then
343345
# If quota check fails due to insufficient quota, set the flag
344-
if grep -q "No region with sufficient quota found" scripts/checkquota.sh; then
346+
if echo "$QUOTA_OUTPUT" | grep -q "No region with sufficient quota found"; then
345347
echo "QUOTA_FAILED=true" >> $GITHUB_ENV
346348
fi
347-
exit 1 # Fail the pipeline if any other failure occurs
349+
exit 1 # Fail the pipeline if any failure occurs
348350
fi
349351
350352
- name: Set Quota Failure Output

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ eggs/
3636
*.swo
3737

3838
# Node
39-
/src/app/frontend/node_modules/
40-
/src/app/frontend-server/node_modules/
41-
/src/app/frontend-server/static/
42-
/src/app/frontend-server/*.zip
39+
/src/app/node_modules/
40+
/src/app/server/node_modules/
41+
/src/app/server/static/
42+
/src/app/server/*.zip
4343
node_modules/
4444

4545
# Build output
4646
/src/app/static/
47-
/src/app/frontend/dist/
47+
/src/app/dist/
4848

4949
# Logs
5050
*.log

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Follow the quick deploy steps on the deployment guide to deploy this solution to
7777
[Click here to launch the deployment guide](./docs/DEPLOYMENT.md)
7878
<br/><br/>
7979

80-
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/content-generation-solution-accelerator) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/content-generation-solution-accelerator) | [![Open in Visual Studio Code Web](https://img.shields.io/static/v1?style=for-the-badge&label=Visual%20Studio%20Code%20(Web)&message=Open&color=blue&logo=visualstudiocode&logoColor=white)](https://vscode.dev/azure/?vscode-azure-exp=foundry&agentPayload=eyJiYXNlVXJsIjogImh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9taWNyb3NvZnQvY29udGVudC1nZW5lcmF0aW9uLXNvbHV0aW9uLWFjY2VsZXJhdG9yL3JlZnMvaGVhZHMvbWFpbi9jb250ZW50LWdlbi9pbmZyYS92c2NvZGVfd2ViIiwgImluZGV4VXJsIjogIi9pbmRleC5qc29uIiwgInZhcmlhYmxlcyI6IHsiYWdlbnRJZCI6ICIiLCAiY29ubmVjdGlvblN0cmluZyI6ICIiLCAidGhyZWFkSWQiOiAiIiwgInVzZXJNZXNzYWdlIjogIiIsICJwbGF5Z3JvdW5kTmFtZSI6ICIiLCAibG9jYXRpb24iOiAiIiwgInN1YnNjcmlwdGlvbklkIjogIiIsICJyZXNvdXJjZUlkIjogIiIsICJwcm9qZWN0UmVzb3VyY2VJZCI6ICIiLCAiZW5kcG9pbnQiOiAiIn0sICJjb2RlUm91dGUiOiBbImFpLXByb2plY3RzLXNkayIsICJweXRob24iLCAiZGVmYXVsdC1henVyZS1hdXRoIiwgImVuZHBvaW50Il19) |
80+
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/content-generation-solution-accelerator) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/content-generation-solution-accelerator) | [![Open in Visual Studio Code Web](https://img.shields.io/static/v1?style=for-the-badge&label=Visual%20Studio%20Code%20(Web)&message=Open&color=blue&logo=visualstudiocode&logoColor=white)](https://vscode.dev/azure/?vscode-azure-exp=foundry&agentPayload=eyJiYXNlVXJsIjogImh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9taWNyb3NvZnQvY29udGVudC1nZW5lcmF0aW9uLXNvbHV0aW9uLWFjY2VsZXJhdG9yL3JlZnMvaGVhZHMvbWFpbi9pbmZyYS92c2NvZGVfd2ViIiwgImluZGV4VXJsIjogIi9pbmRleC5qc29uIiwgInZhcmlhYmxlcyI6IHsiYWdlbnRJZCI6ICIiLCAiY29ubmVjdGlvblN0cmluZyI6ICIiLCAidGhyZWFkSWQiOiAiIiwgInVzZXJNZXNzYWdlIjogIiIsICJwbGF5Z3JvdW5kTmFtZSI6ICIiLCAibG9jYXRpb24iOiAiIiwgInN1YnNjcmlwdGlvbklkIjogIiIsICJyZXNvdXJjZUlkIjogIiIsICJwcm9qZWN0UmVzb3VyY2VJZCI6ICIiLCAiZW5kcG9pbnQiOiAiIn0sICJjb2RlUm91dGUiOiBbImFpLXByb2plY3RzLXNkayIsICJweXRob24iLCAiZGVmYXVsdC1henVyZS1hdXRoIiwgImVuZHBvaW50Il19) |
8181
|---|---|---|
8282

8383
<br/>

azure.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
template: content-generation@1.22
88

99
requiredVersions:
10-
azd: '>= 1.18.0'
10+
azd: '>= 1.18.0 != 1.23.9'
1111

1212
parameters:
1313
solutionPrefix:

azure_custom.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
template: document-generation@1.0
88

99
requiredVersions:
10-
azd: '>= 1.18.0'
10+
azd: '>= 1.18.0 != 1.23.9'
1111

1212
parameters:
1313
solutionPrefix:

docs/AVMPostDeploymentGuide.md

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
# AVM Post Deployment Guide
2+
3+
> **📋 Note**: This guide is specifically for post-deployment steps after using the AVM template. For complete deployment from scratch, see the main [Deployment Guide](./DEPLOYMENT.md).
4+
5+
---
6+
7+
This document provides guidance on post-deployment steps after deploying the Content Generation solution accelerator from the [AVM (Azure Verified Modules) repository](https://github.com/Azure/bicep-registry-modules/tree/main/avm/ptn/sa/content-generation).
8+
9+
## Overview
10+
11+
After successfully deploying the Content Generation Solution Accelerator using the AVM template, you'll need to complete some configuration steps to make the solution fully operational. The AVM deployment provisions all required Azure resources, and the post-deployment process will upload sample data, create search indexes, and verify the application is ready to use.
12+
13+
---
14+
15+
## Prerequisites
16+
17+
Before starting the post-deployment process, ensure you have the following:
18+
19+
### 1. Azure Subscription & Permissions
20+
21+
You need access to an [Azure subscription](https://azure.microsoft.com/free/) with permissions to:
22+
- Create resource groups and resources
23+
- Create app registrations
24+
- Assign roles at the resource group level (Contributor + RBAC)
25+
26+
📖 Follow the steps in [Azure Account Set Up](./AzureAccountSetUp.md) for detailed instructions.
27+
28+
### 2. Deployed Infrastructure
29+
30+
A successful Content Generation solution accelerator deployment from the [AVM repository](https://github.com/Azure/bicep-registry-modules/tree/main/avm/ptn/sa/content-generation).
31+
32+
The deployment should have created the following resources:
33+
- Azure App Service (frontend web app)
34+
- Azure Container Instance (backend API)
35+
- Azure AI Foundry (AI orchestration)
36+
- Azure OpenAI Service (GPT and Image models)
37+
- Azure Cosmos DB (product catalog and conversations)
38+
- Azure Blob Storage (product images and generated images)
39+
- Azure AI Search (product search index)
40+
- User Assigned Managed Identity
41+
- App Service Plan
42+
43+
**Optional resources** (depending on deployment parameters):
44+
- Log Analytics Workspace and Application Insights (if monitoring is enabled)
45+
- Virtual Network, Private DNS Zones, and Private Endpoints (if private networking is enabled)
46+
- Azure Bastion and Jumpbox VM (if enabled for private network administration)
47+
48+
**Important:** The deployment references an **existing Azure Container Registry** (specified via the `acrName` parameter) that must contain pre-built container images (`content-gen-app` and `content-gen-api`). The ACR is not created by this deployment.
49+
50+
### 3. Required Tools
51+
52+
Ensure the following tools are installed on your machine:
53+
54+
| Tool | Version | Download Link |
55+
|------|---------|---------------|
56+
| PowerShell | v7.0+ | [Install PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.5) |
57+
| Azure CLI | v2.50+ | [Install Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) |
58+
| Python | 3.11+ | [Download Python](https://www.python.org/downloads/) |
59+
| Git | Latest | [Download Git](https://git-scm.com/downloads) |
60+
61+
#### Important Note for PowerShell Users
62+
63+
If you encounter issues running PowerShell scripts due to execution policy restrictions, you can temporarily adjust the `ExecutionPolicy` by running the following command in an elevated PowerShell session:
64+
65+
```powershell
66+
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
67+
```
68+
69+
This will allow the scripts to run for the current session without permanently changing your system's policy.
70+
71+
---
72+
73+
## Post-Deployment Steps
74+
75+
### Step 1: Clone the Repository
76+
77+
Clone this repository to access the post-deployment scripts and sample data:
78+
79+
```powershell
80+
git clone https://github.com/microsoft/content-generation-solution-accelerator.git
81+
cd content-generation-solution-accelerator
82+
```
83+
84+
---
85+
86+
### Step 2: Run the Post-Deployment Script
87+
88+
The AVM deployment provisions the Azure infrastructure but does NOT include automated post-deployment hooks. You need to manually run the post-deployment script to upload sample data and create search indexes.
89+
90+
> **📝 Note**: Unlike `azd up` deployments which run post-deployment hooks automatically via `azure.yaml`, AVM deployments require manual execution of the post-deployment script.
91+
92+
#### 2.1 Login to Azure
93+
94+
```shell
95+
az login
96+
```
97+
98+
> 💡 **Tip**: If using VS Code Web or environments without browser access, use device code authentication:
99+
> ```shell
100+
> az login --use-device-code
101+
> ```
102+
103+
#### 2.2 Set Up Environment
104+
105+
Navigate to the repository root directory and create a Python virtual environment:
106+
107+
**For Windows (PowerShell):**
108+
```powershell
109+
python -m venv .venv
110+
.\.venv\Scripts\Activate.ps1
111+
pip install -r ./scripts/requirements-post-deploy.txt
112+
```
113+
114+
**For Linux/Mac (bash):**
115+
```bash
116+
python3 -m venv .venv
117+
source .venv/bin/activate
118+
pip install -r ./scripts/requirements-post-deploy.txt
119+
```
120+
121+
#### 2.3 Execute the Post-Deployment Script
122+
123+
Run the post-deployment script with your resource group name. The script will automatically retrieve resource names from the Azure deployment outputs.
124+
125+
**For Windows (PowerShell):**
126+
```powershell
127+
python ./scripts/post_deploy.py -g <your-resource-group-name> --skip-tests
128+
```
129+
130+
**For Linux/Mac (bash):**
131+
```bash
132+
python3 ./scripts/post_deploy.py -g <your-resource-group-name> --skip-tests
133+
```
134+
135+
**Example:**
136+
```powershell
137+
python ./scripts/post_deploy.py -g rg-contentgen-prod --skip-tests
138+
```
139+
140+
> ⚠️ **Important**: The script uses Azure CLI authentication and will automatically discover resource names from deployment outputs. Ensure you're logged in with `az login` before running.
141+
142+
**How it works:**
143+
- The script queries the deployment outputs using the resource group name
144+
- It automatically retrieves App Service, Storage Account, Cosmos DB, and AI Search names
145+
- No need to manually specify individual resource names
146+
147+
**Alternative:** If you prefer to specify resources explicitly, you can use environment variables or command-line arguments:
148+
```powershell
149+
# Using environment variables
150+
$env:RESOURCE_GROUP_NAME = "rg-contentgen-prod"
151+
$env:APP_SERVICE_NAME = "app-contentgen-abc123"
152+
$env:AZURE_BLOB_ACCOUNT_NAME = "stcontentgenabc123"
153+
$env:COSMOSDB_ACCOUNT_NAME = "cosmos-contentgen-abc123"
154+
$env:AI_SEARCH_SERVICE_NAME = "search-contentgen-abc123"
155+
python ./scripts/post_deploy.py --skip-tests
156+
```
157+
158+
The script will:
159+
- Upload sample product data to Cosmos DB
160+
- Upload sample product images to Blob Storage
161+
- Create and populate the Azure AI Search index
162+
- Verify all connections and configurations
163+
164+
---
165+
166+
### Step 3: Access the Application
167+
168+
1. Navigate to the [Azure Portal](https://portal.azure.com)
169+
2. Open the **resource group** created during deployment
170+
3. Locate the **App Service** (name typically starts with `app-contentgen-`)
171+
4. Copy the **URL** from the Overview page (format: `https://app-contentgen-<unique-id>.azurewebsites.net`)
172+
5. Open the URL in your browser to access the application
173+
174+
> 📝 **Note**: It may take a few minutes for the App Service to start up after deployment.
175+
176+
---
177+
178+
### Step 4: Configure Authentication (Optional)
179+
180+
If you want to enable authentication for your application, follow the [App Authentication Guide](./AppAuthentication.md).
181+
182+
> **⚠️ Important**: Authentication changes can take up to 10 minutes to propagate.
183+
184+
---
185+
186+
### Step 5: Verify Data Processing
187+
188+
Confirm your deployment is working correctly:
189+
190+
| Check | Location | How to Verify |
191+
|-------|----------|---------------|
192+
| ✅ Sample data uploaded | Azure Cosmos DB | Navigate to Cosmos DB → Data Explorer → Check `products` and `conversations` containers |
193+
| ✅ Sample images uploaded | Azure Blob Storage | Navigate to Storage Account → Containers → Check `product-images` container |
194+
| ✅ AI Search index created | Azure AI Search | Navigate to AI Search → Indexes → Verify `products-index` exists and has documents |
195+
| ✅ Application loads | App Service URL | Open the web app URL and verify the welcome screen appears |
196+
197+
---
198+
199+
## Getting Started
200+
201+
To learn how to use the Content Generation solution and try sample workflows, see the [Sample Workflow](./DEPLOYMENT.md#sample-workflow) section in the main Deployment Guide.
202+
203+
---
204+
205+
## Clean Up Resources
206+
207+
If you need to delete the resources after testing or a failed deployment:
208+
209+
Follow the steps in [Delete Resource Group](./DeleteResourceGroup.md) to clean up all deployed resources.
210+
211+
> ⚠️ **Warning**: Deleting the resource group will permanently delete all resources and data. This action cannot be undone.

docs/AZD_DEPLOYMENT.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ Before running `azd up`, copy the contents from the production configuration fil
100100

101101
### 4. Deploy
102102

103+
**NOTE:** If you are running the latest azd version (version 1.23.9), please run the following command.
104+
```bash
105+
azd config set provision.preflight off
106+
```
107+
103108
```bash
104109
azd up
105110
```
@@ -246,7 +251,7 @@ Error: az webapp deploy failed
246251

247252
**Solution**: Ensure the frontend builds successfully:
248253
```bash
249-
cd src/app/frontend
254+
cd src/app
250255
npm install
251256
npm run build
252257
```

0 commit comments

Comments
 (0)