Skip to content

Commit 54b1b90

Browse files
Merge pull request #783 from microsoft/dev
chore: Dev to Main merge
2 parents 1d88a7f + 47e087c commit 54b1b90

24 files changed

+1816
-1267
lines changed

.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=

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/CustomizingAzdParameters.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ By default this template will use the environment name as the prefix to prevent
1010
| -------------------------------------- | ------- | ---------------------------- | ----------------------------------------------------------------------------- |
1111
| `AZURE_LOCATION` | string | `<User selects during deployment>` | Sets the Azure region for resource deployment. Allowed: `australiaeast`, `centralus`, `eastasia`, `eastus`, `eastus2`, `japaneast`, `northeurope`, `southeastasia`, `swedencentral`, `uksouth`, `westus`, `westus3`. |
1212
| `AZURE_ENV_NAME` | string | `contentgen` | Sets the environment name prefix for all Azure resources (3-15 characters). |
13-
| `secondaryLocation` | string | `uksouth` | Specifies a secondary Azure region for database creation. |
14-
| `gptModelName` | string | `gpt-5.1` | Specifies the GPT model name to deploy. |
15-
| `gptModelVersion` | string | `2025-11-13` | Sets the GPT model version. |
16-
| `gptModelDeploymentType` | string | `GlobalStandard` | Defines the model deployment type (allowed: `Standard`, `GlobalStandard`). |
17-
| `gptModelCapacity` | integer | `150` | Sets the GPT model token capacity (minimum: `10`). |
18-
| `imageModelChoice` | string | `gpt-image-1-mini` | Image model to deploy (allowed: `gpt-image-1-mini`, `gpt-image-1.5`, `none`). |
19-
| `imageModelCapacity` | integer | `1` | Sets the image model deployment capacity in RPM (minimum: `1`). |
20-
| `azureOpenaiAPIVersion` | string | `2025-01-01-preview` | Specifies the API version for Azure OpenAI service. |
13+
| `SECONDARY_LOCATION` | string | `uksouth` | Specifies a secondary Azure region for database creation. |
14+
| `AZURE_OPENAI_GPT_MODEL` | string | `gpt-5.1` | Specifies the GPT model name to deploy. |
15+
| `GPT_MODEL_VERSION` | string | `2025-11-13` | Sets the GPT model version. |
16+
| `GPT_MODEL_DEPLOYMENT_TYPE` | string | `GlobalStandard` | Defines the model deployment type (allowed: `Standard`, `GlobalStandard`). |
17+
| `GPT_MODEL_CAPACITY` | integer | `150` | Sets the GPT model token capacity (minimum: `10`). |
18+
| `AZURE_OPENAI_IMAGE_MODEL` | string | `gpt-image-1-mini` | Image model to deploy (allowed: `gpt-image-1-mini`, `gpt-image-1.5`, `none`). |
19+
| `IMAGE_MODEL_CAPACITY` | integer | `1` | Sets the image model deployment capacity in RPM (minimum: `1`). |
20+
| `AZURE_OPENAI_API_VERSION` | string | `2025-01-01-preview` | Specifies the API version for Azure OpenAI service. |
2121
| `AZURE_ENV_OPENAI_LOCATION` | string | `<User selects during deployment>` | Sets the Azure region for OpenAI resource deployment. |
2222
| `AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID` | string | `""` | Reuses an existing Log Analytics Workspace instead of creating a new one. |
2323
| `AZURE_EXISTING_AI_PROJECT_RESOURCE_ID`| string | `""` | Reuses an existing AI Foundry Project instead of creating a new one. |
@@ -36,8 +36,8 @@ azd env set <PARAMETER_NAME> <VALUE>
3636

3737
```bash
3838
azd env set AZURE_LOCATION westus2
39-
azd env set gptModelName gpt-5.1
40-
azd env set gptModelDeploymentType Standard
41-
azd env set imageModelChoice gpt-image-1-mini
39+
azd env set AZURE_OPENAI_GPT_MODEL gpt-5.1
40+
azd env set GPT_MODEL_DEPLOYMENT_TYPE Standard
41+
azd env set AZURE_OPENAI_IMAGE_MODEL gpt-image-1-mini
4242
azd env set ACR_NAME contentgencontainerreg
4343
```

docs/DEPLOYMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ When you start the deployment, most parameters will have **default values**, but
137137
| **GPT Model Version** | The version of the selected GPT model. | 2025-11-13 |
138138
| **OpenAI API Version** | The Azure OpenAI API version to use. | 2025-01-01-preview |
139139
| **GPT Model Deployment Capacity** | Configure capacity for **GPT models** (in thousands). | 150k |
140-
| **Image Model** | Choose from **gpt-image-1-mini, gpt-image-1.5** | gpt-image-1-mini |
140+
| **Image Model** | Choose from **gpt-image-1-mini, gpt-image-1.5** | gpt-image-1-mini |
141141
| **Image Tag** | Docker image tag to deploy. Common values: `latest`, `dev`, `hotfix`. | latest |
142142
| **Existing Log Analytics Workspace** | To reuse an existing Log Analytics Workspace ID. | *(empty)* |
143143
| **Existing Azure AI Foundry Project** | To reuse an existing Azure AI Foundry Project ID instead of creating a new one. | *(empty)* |

docs/TECHNICAL_GUIDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ See `src/backend/settings.py` for all configuration options. Key settings:
159159
| `AZURE_OPENAI_GPT_MODEL` | GPT model deployment name |
160160
| `AZURE_OPENAI_GPT_IMAGE_ENDPOINT` | Azure OpenAI endpoint for GPT image model (if separate) |
161161
| `AZURE_OPENAI_IMAGE_MODEL` | GPT image model deployment name (gpt-image-1-mini) |
162-
| `COSMOS_ENDPOINT` | Azure Cosmos DB endpoint |
163-
| `COSMOS_DATABASE` | Cosmos DB database name |
164-
| `AZURE_STORAGE_ACCOUNT_NAME` | Storage account name |
162+
| `AZURE_COSMOS_ENDPOINT` | Azure Cosmos DB endpoint |
163+
| `AZURE_COSMOS_DATABASE_NAME` | Cosmos DB database name |
164+
| `AZURE_BLOB_ACCOUNT_NAME` | Storage account name |
165165
| `BRAND_*` | Brand guideline parameters |
166166

167167
### Brand Guidelines

0 commit comments

Comments
 (0)