Skip to content

Commit f991171

Browse files
Merge pull request #1 from microsoft/main
merge changes from main repo to fork
2 parents aa95a45 + f427ed0 commit f991171

File tree

63 files changed

+64877
-5539
lines changed

Some content is hidden

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

63 files changed

+64877
-5539
lines changed

.github/workflows/deploy-KMGeneric.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
env:
1515
GPT_MIN_CAPACITY: 150
1616
TEXT_EMBEDDING_MIN_CAPACITY: 80
17-
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
17+
BRANCH_NAME: ${{ github.event.workflow_run.head_branch || github.head_ref || github.ref_name }}
1818
jobs:
1919
deploy:
2020
runs-on: ubuntu-latest
@@ -112,15 +112,19 @@ jobs:
112112
echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}"
113113
- name: Determine Tag Name Based on Branch
114114
id: determine_tag
115-
run: echo "tagname=${{ github.ref_name == 'main' && 'latest_fdp' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || github.ref_name == 'dependabotchanges' && 'dependabotchanges' || github.head_ref || 'default' }}" >> $GITHUB_OUTPUT
115+
run: echo "tagname=${{ github.ref_name == 'main' && 'latest_waf' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || github.ref_name == 'dependabotchanges' && 'dependabotchanges' || 'latest_waf' }}" >> $GITHUB_OUTPUT
116116
- name: Deploy Bicep Template
117117
id: deploy
118118
run: |
119119
set -e
120+
121+
# Generate current timestamp in desired format: YYYY-MM-DDTHH:MM:SS.SSSSSSSZ
122+
current_date=$(date -u +"%Y-%m-%dT%H:%M:%S.%7NZ")
123+
120124
az deployment group create \
121125
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
122126
--template-file infra/main.bicep \
123-
--parameters solutionName=${{env.SOLUTION_PREFIX}} contentUnderstandingLocation="swedencentral" secondaryLocation="${{ env.AZURE_LOCATION }}" imageTag=${{ steps.determine_tag.outputs.tagname }} gptDeploymentCapacity=150 aiDeploymentsLocation="${{ env.AZURE_LOCATION }}" createdBy="Pipeline"
127+
--parameters solutionName=${{env.SOLUTION_PREFIX}} contentUnderstandingLocation="swedencentral" secondaryLocation="${{ env.AZURE_LOCATION }}" imageTag=${{ steps.determine_tag.outputs.tagname }} gptDeploymentCapacity=150 azureAiServiceLocation="${{ env.AZURE_LOCATION }}" createdBy="Pipeline" tags="{'SecurityControl':'Ignore','Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}"
124128
125129
126130

.github/workflows/docker-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
id: determine_tag
5050
run: |
5151
if [[ "${{ github.ref_name }}" == "main" ]]; then
52-
echo "tagname=latest_fdp" >> $GITHUB_OUTPUT
52+
echo "tagname=latest_waf" >> $GITHUB_OUTPUT
5353
elif [[ "${{ github.ref_name }}" == "dev" ]]; then
5454
echo "tagname=dev" >> $GITHUB_OUTPUT
5555
elif [[ "${{ github.ref_name }}" == "demo" ]]; then

azure.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ environment:
77
name: conversation-knowledge-mining
88

99
requiredVersions:
10-
azd: ">= 1.15.0"
10+
azd: ">= 1.18.0"
1111

1212
metadata:
1313

documents/ACRBuildAndPushGuide.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Azure Container Registry (ACR) – Build & Push Guide
2+
3+
This guide provides step-by-step instructions to build and push Docker images for **WebApp** and **Backend** services into Azure Container Registry (ACR).
4+
5+
## 📋 Prerequisites
6+
Before starting, ensure you have:
7+
- An active [Azure Subscription](https://portal.azure.com/)
8+
- [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) installed and logged in
9+
- [Docker Desktop](https://docs.docker.com/get-docker/) installed and running
10+
- Access to your Azure Container Registry (ACR)
11+
- To create an Azure Container Registry (ACR), you can refer to the following guides:
12+
13+
- [Create Container Registry using Azure CLI](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-azure-cli)
14+
15+
- [Create Container Registry using Azure Portal](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal?tabs=azure-cli)
16+
17+
- [Create Container Registry using PowerShell](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-powershell)
18+
19+
- [Create Container Registry using ARM Template](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-geo-replication-template)
20+
21+
- [Create Container Registry using Bicep](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-bicep?tabs=CLI)
22+
23+
---
24+
25+
Login to ACR :
26+
``` bash
27+
az acr login --name $ACR_NAME
28+
```
29+
30+
## 🚀 Build and Push Images
31+
32+
**Backend :**
33+
34+
```bash
35+
az acr login --name <containerregname>
36+
docker build --no-cache -f api/ApiApp.Dockerfile -t <acrloginserver>/<repo>:<tagname> .
37+
docker push <acrloginserver>/<repo>:<tagname>
38+
```
39+
40+
If you want to update image tag and image manually you can follow below steps:
41+
- Go to your api App Service in the [Azure Portal](https://portal.azure.com/#home).
42+
- In the left menu, select Deployment → Deployment Center
43+
- Under Registry settings, you can configure:
44+
45+
- Image Source → (e.g., Azure Container Registry / Docker Hub / Other).
46+
47+
- Image Name → e.g., myapp/backend.
48+
49+
- Tag → e.g., v1.2.3.
50+
51+
![alt text](./Images/AppServiceContainer.png)
52+
53+
**WebApp :**
54+
55+
```bash
56+
az acr login --name <containerregname>
57+
docker build --no-cache -f App/WebApp.Dockerfile -t <acrloginserver>/<repo>:<tagname> .
58+
docker push <acrloginserver>/<repo>:<tagname>
59+
```
60+
61+
If you want to update image tag and image manually you can follow below steps:
62+
- Go to your App Service in the [Azure Portal](https://portal.azure.com/#home).
63+
- In the left menu, select Deployment → Deployment Center
64+
- Under Registry settings, you can configure:
65+
66+
- Image Source → (e.g., Azure Container Registry / Docker Hub / Other).
67+
68+
- Image Name → e.g., myapp/backend.
69+
70+
- Tag → e.g., v1.2.3.
71+
72+
![alt text](./Images/AppServiceContainer.png)
73+
74+
75+
## ✅ Verification
76+
77+
Run the following command to verify that images were pushed successfully:
78+
```bash
79+
az acr repository list --name $ACR_NAME --output table
80+
```
81+
82+
You should see repositories in the output.
83+
84+
## 📝 Notes
85+
86+
- Always use meaningful tags (v1.0.0, staging, prod) instead of just latest.
87+
88+
- If you are pushing from a CI/CD pipeline, make sure the pipeline agent has access to Docker and ACR.
89+
90+
- For private images, ensure your services (e.g., Azure Container Apps, AKS, App Service) are configured with appropriate ACR pull permissions.
91+
92+
93+

documents/CustomizeData.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,17 @@ If you would like to update the solution to leverage your own data please follow
2121
```
2222
a. resourcegroupname_param - the name of the resource group.
2323

24+
> Note (WAF‑aligned deployments): If you deployed the solution with the WAF / private networking option enabled, you must run the data processing script **from inside the deployed VM (jumpbox / processing VM)** so it can reach the private endpoints. Follow these steps:
25+
>
26+
> 1. Connect to the VM (Azure Bastion, SSH, or RDP depending on OS).
27+
> 2. Ensure the repo (or the `infra/scripts` folder) is present. If not, clone or pull it.
28+
> 3. Open a Bash-compatible shell (Git Bash on Windows, or native bash on Linux).
29+
> 4. Run `az login` (add `--tenant <tenantId>` if required by your org policy).
30+
> 5. Navigate to `infra/scripts` and execute:
31+
> ```bash
32+
> bash run_process_data_scripts.sh <resource-group-name>
33+
> ```
34+
> 6. Replace `<resource-group-name>` with the name of the resource group you deployed (same value used for `resourcegroupname_param`).
35+
>
36+
> Tip: If Azure CLI is not installed on the VM, install it first (see official docs) before running the script.
37+

documents/CustomizingAzdParameters.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ By default this template will use the environment name as the prefix to prevent
1919
| `AZURE_OPENAI_API_VERSION` | string | `2025-01-01-preview` | Specifies the API version for Azure OpenAI. |
2020
| `AZURE_OPENAI_DEPLOYMENT_MODEL_CAPACITY` | integer | `30` | Sets the GPT model capacity. |
2121
| `AZURE_OPENAI_EMBEDDING_MODEL` | string | `text-embedding-ada-002` | Sets the name of the embedding model to use. |
22-
| `AZURE_ENV_IMAGETAG` | string | `latest` | Sets the image tag (`latest`, `dev`, `hotfix`, etc.). |
22+
| `AZURE_ENV_IMAGETAG` | string | `latest_waf` | Sets the image tag (`latest_waf`, `dev`, `hotfix`, etc.). |
2323
| `AZURE_OPENAI_EMBEDDING_MODEL_CAPACITY` | integer | `80` | Sets the capacity for the embedding model deployment. |
2424
| `AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID` | string | Guide to get your [Existing Workspace ID](/documents/re-use-log-analytics.md) | Reuses an existing Log Analytics Workspace instead of creating a new one. |
2525
| `USE_LOCAL_BUILD` | string | `false` | Indicates whether to use a local container build for deployment. |
2626
| `AZURE_EXISTING_AI_PROJECT_RESOURCE_ID` | string | `<Existing AI Project resource Id>` | Reuses an existing AIFoundry and AIFoundryProject instead of creating a new one. |
27-
27+
| `AZURE_ENV_VM_ADMIN_USERNAME` | string | `take(newGuid(), 20)` | The administrator username for the virtual machine. |
28+
| `AZURE_ENV_VM_ADMIN_PASSWORD` | string | `newGuid()` | The administrator password for the virtual machine. |
2829

2930

3031
## How to Set a Parameter

documents/DeploymentGuide.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,45 @@ This will allow the scripts to run for the current session without permanently c
3232

3333
## Deployment Options & Steps
3434

35+
### Sandbox or WAF Aligned Deployment Options
36+
37+
The [`infra`](../infra) folder of the Multi Agent Solution Accelerator contains the [`main.bicep`](../infra/main.bicep) Bicep script, which defines all Azure infrastructure components for this solution.
38+
39+
By default, the `azd up` command uses the [`main.parameters.json`](../infra/main.parameters.json) file to deploy the solution. This file is pre-configured for a **sandbox environment** — ideal for development and proof-of-concept scenarios, with minimal security and cost controls for rapid iteration.
40+
41+
For **production deployments**, the repository also provides [`main.waf.parameters.json`](../infra/main.waf.parameters.json), which applies a [Well-Architected Framework (WAF) aligned](https://learn.microsoft.com/en-us/azure/well-architected/) configuration. This option enables additional Azure best practices for reliability, security, cost optimization, operational excellence, and performance efficiency, such as:
42+
43+
- Enhanced network security (e.g., Network protection with private endpoints)
44+
- Stricter access controls and managed identities
45+
- Logging, monitoring, and diagnostics enabled by default
46+
- Resource tagging and cost management recommendations
47+
48+
**How to choose your deployment configuration:**
49+
50+
* Use the default `main.parameters.json` file for a **sandbox/dev environment**
51+
* For a **WAF-aligned, production-ready deployment**, copy the contents of `main.waf.parameters.json` into `main.parameters.json` before running `azd up`
52+
53+
---
54+
55+
### VM Credentials Configuration
56+
57+
By default, the solution sets the VM administrator username and password from environment variables.
58+
59+
To set your own VM credentials before deployment, use:
60+
61+
```sh
62+
azd env set AZURE_ENV_VM_ADMIN_USERNAME <your-username>
63+
azd env set AZURE_ENV_VM_ADMIN_PASSWORD <your-password>
64+
```
65+
66+
> [!TIP]
67+
> Always review and adjust parameter values (such as region, capacity, security settings and log analytics workspace configuration) to match your organization’s requirements before deploying. For production, ensure you have sufficient quota and follow the principle of least privilege for all identities and role assignments.
68+
69+
> [!IMPORTANT]
70+
> The WAF-aligned configuration is under active development. More Azure Well-Architected recommendations will be added in future updates.
71+
72+
### Deployment Steps
73+
3574
Pick from the options below to see step-by-step instructions for GitHub Codespaces, VS Code Dev Containers, Local Environments, and Bicep deployments.
3675

3776
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/Conversation-Knowledge-Mining-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/Conversation-Knowledge-Mining-Solution-Accelerator) |
@@ -80,7 +119,7 @@ If you're not using one of the above options for opening the project, then you'l
80119

81120
1. Make sure the following tools are installed:
82121
- [PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.5) <small>(v7.0+)</small> - available for Windows, macOS, and Linux.
83-
- [Azure Developer CLI (azd)](https://aka.ms/install-azd) <small>(v1.15.0+)</small> - version
122+
- [Azure Developer CLI (azd)](https://aka.ms/install-azd) <small>(v1.18.0+)</small> - version
84123
- [Python 3.9+](https://www.python.org/downloads/)
85124
- [Docker Desktop](https://www.docker.com/products/docker-desktop/)
86125
- [Git](https://git-scm.com/downloads)
@@ -118,7 +157,7 @@ When you start the deployment, most parameters will have **default values**, but
118157
| **GPT Model Deployment Capacity** | Configure capacity for **GPT models** (in thousands). | 30k |
119158
| **Embedding Model** | Default: **text-embedding-ada-002**. | text-embedding-ada-002 |
120159
| **Embedding Model Capacity** | Set the capacity for **embedding models** (in thousands). | 80k |
121-
| **Image Tag** | Docker image tag to deploy. Common values: `latest`, `dev`, `hotfix`. | latest |
160+
| **Image Tag** | Docker image tag to deploy. Common values: `latest_waf`, `dev`, `hotfix`. | latest_waf |
122161
| **Use Local Build** | Boolean flag to determine if local container builds should be used. | false |
123162
| **Existing Log Analytics Workspace** | To reuse an existing Log Analytics Workspace ID. | *(empty)* |
124163
| **Existing Azure AI Foundry Project** | To reuse an existing Azure AI Foundry Project ID instead of creating a new one. | *(empty)* |
121 KB
Loading

documents/Images/ContainerApp.png

94.6 KB
Loading

documents/LocalDebuggingSetup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Install these tools before you start:
1515
- [PowerShell 7.0+](https://github.com/PowerShell/PowerShell#get-powershell).
1616
- [Node.js (LTS)](https://nodejs.org/en).
1717
- [Git](https://git-scm.com/downloads).
18-
- [Azure Developer CLI (azd) v1.15.0+](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/install-azd).
18+
- [Azure Developer CLI (azd) v1.18.0+](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/install-azd).
1919
- [Microsoft ODBC Driver 17](https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server?view=sql-server-ver16) for SQL Server.
2020

2121

0 commit comments

Comments
 (0)