Skip to content

Commit 705f61b

Browse files
Merge pull request #457 from microsoft/kings-dkm-dev
feat: Down merge
2 parents d896727 + afe3ea2 commit 705f61b

File tree

14 files changed

+51546
-1407
lines changed

14 files changed

+51546
-1407
lines changed

Deployment/resourcedeployment.ps1

Lines changed: 39 additions & 98 deletions
Large diffs are not rendered by default.

docs/CustomizingAzdParameters.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## [Optional]: Customizing resource names
2+
3+
By default this template will use the environment name as the prefix to prevent naming collisions within Azure. The parameters below show the default values. You only need to run the statements below if you need to change the values.
4+
5+
> To override any of the parameters, run `azd env set <PARAMETER_NAME> <VALUE>` before running `azd up`. On the first azd command, it will prompt you for the environment name. Be sure to choose 3-20 characters alphanumeric unique name.
6+
7+
## Parameters
8+
9+
| Name | Type | Default Value | Purpose |
10+
| ------------------------------- | ------ | ----------------- | --------------------------------------------------------------------------------------------------- |
11+
| `AZURE_ENV_NAME` | string | `dkm` | Used as a prefix for all resource names to ensure uniqueness across environments. |
12+
| `AZURE_LOCATION` | string | `<User selects during deployment>` | Location of the Azure resources. Controls where the infrastructure will be deployed. |
13+
| `AZURE_ENV_MODEL_DEPLOYMENT_TYPE` | string | `GlobalStandard` | Defines the deployment type for the AI model (e.g., Standard, GlobalStandard). |
14+
| `AZURE_ENV_MODEL_NAME` | string | `gpt-4.1` | Specifies the name of the GPT model to be deployed. |
15+
| `AZURE_ENV_MODEL_CAPACITY` | int | `100` | Sets the GPT model capacity. |
16+
| `AZURE_ENV_MODEL_VERSION` | string | `2024-08-06` | Version of the GPT model to be used for deployment. |
17+
| `AZURE_ENV_EMBEDDING_MODEL_NAME` | string | text-embedding-3-large | Sets the name of the embedding model to use. |
18+
| `AZURE_ENV_EMBEDDING_MODEL_VERSION` | string | `200` | *(empty)* |
19+
| `AZURE_ENV_EMBEDDING_MODEL_CAPACITY` | string | Configure capacity for embedding models (in thousands). | Set the capacity for embedding models (in thousands). |
20+
| `AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID` | string | Guide to get your [Existing Workspace ID](/docs/re-use-log-analytics.md) | Set this if you want to reuse an existing Log Analytics Workspace instead of creating a new one. |
21+
| `AZURE_ENV_VM_ADMIN_USERNAME` | string | `take(newGuid(), 20)` | The administrator username for the virtual machine. |
22+
| `AZURE_ENV_VM_ADMIN_PASSWORD` | string | `newGuid()` | The administrator password for the virtual machine. |
23+
| `AZURE_ENV_ENABLE_TELEMETRY` | bool | `true` | Enables telemetry for monitoring and diagnostics. |
24+
---
25+
26+
## How to Set a Parameter
27+
28+
To customize any of the above values, run the following command **before** `azd up`:
29+
30+
```bash
31+
azd env set <PARAMETER_NAME> <VALUE>
32+
```
33+
34+
Set the Log Analytics Workspace Id if you need to reuse the existing workspace which is already existing
35+
```shell
36+
azd env set AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID '/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.OperationalInsights/workspaces/<workspace-name>'
37+
```
38+
39+
**Example:**
40+
41+
```bash
42+
azd env set AZURE_LOCATION westus2
43+
```

docs/DeploymentGuide.md

Lines changed: 109 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
77
## Contents
88
* [Prerequisites](#prerequisites)
9-
* [Regional Availability](#regional-availability)
10-
* [Deployment](#deployment)
9+
* [Deployment Options](#deployment-options--steps)
10+
* [Deployment](#deployment-steps)
1111
* [Next Steps](#next-steps)
1212

1313
## Prerequisites
@@ -42,110 +42,146 @@
4242
<br>
4343
<img src="./images/deployment/Subscription_ResourceProvider.png" alt="ResourceProvider" width="900">
4444

45+
## Deployment Options & Steps
4546

46-
## Regional Availability
47+
### Sandbox or WAF Aligned Deployment Options
4748

48-
*Due to model availability within various data center regions, the following services have been hard-coded to specific regions.*
49+
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.
4950

50-
* **Azure Open AI (GPT 4o mini):**<br>
51-
The solution relies on `GPT-4o mini` and `text-embedding-3-large` models which are all currently available in the 'WestUS3', 'EastUS', 'EastUS2', 'SwedenCentral' region.
52-
Please check the
53-
[model summary table and region availability](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#embeddings) if needed.
51+
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.
5452

55-
* **Azure AI Document Intelligence (East US):**<br>
56-
The solution relies on a `2023-10-31-preview` or later that is currently available in `East US` region.
57-
The deployment region for this model is fixed in 'East US'
53+
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:
5854

55+
- Enhanced network security (e.g., Network protection with private endpoints)
56+
- Stricter access controls and managed identities
57+
- Logging, monitoring, and diagnostics enabled by default
58+
- Resource tagging and cost management recommendations
5959

60-
## Deployment
60+
**How to choose your deployment configuration:**
6161

62-
The automated deployment process is very straightforward and simplified via a single [deployment script](../Deployment/resourcedeployment.ps1) that completes in approximately 10-15 minutes:
62+
* Use the default `main.parameters.json` file for a **sandbox/dev environment**
63+
* For a **WAF-aligned, production-ready deployment**, copy the contents of `main.waf.parameters.json` into `main.parameters.json` before running `azd up`
6364

64-
### Automated Deployment Steps:
65-
1. Deploy Azure resources.
66-
2. Get secret information from Azure resources.
67-
3. Update application configuration files with secrets.
68-
4. Set Application Configuration in Azure App Configuration.
69-
4. Compile application, build image, and push to Azure Container Registry.
70-
5. Configure Kubernetes cluster infrastructure.
71-
6. Update Kubernetes configuration files.
72-
7. Deploy certificates, ingress controller and then application images from Azure Container Registry.
65+
---
7366

67+
### VM Credentials Configuration
7468

75-
### Execute Deployment Script:
76-
Open PowerShell, change directory where you code cloned, then run the deploy script:
69+
By default, the solution sets the VM administrator username and password from environment variables.
70+
If you do not configure these values, a randomly generated GUID will be used for both the username and password.
7771

78-
```
79-
cd .\Deployment\
80-
```
81-
```
82-
.\resourcedeployment.ps1
72+
To set your own VM credentials before deployment, use:
73+
74+
```sh
75+
azd env set AZURE_ENV_VM_ADMIN_USERNAME <your-username>
76+
azd env set AZURE_ENV_VM_ADMIN_PASSWORD <your-password>
8377
```
8478

85-
If you run into issue with PowerShell script file not being digitally signed, you can execute below command:
79+
> [!TIP]
80+
> 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.
8681
87-
```
88-
powershell.exe -ExecutionPolicy Bypass -File ".\resourcedeployment.ps1"
89-
```
9082

91-
You will be prompted for the following parameters with this Screen :
92-
<img src="./images/deployment/Deployment_Screen01.png" width="900" alt-text="Input Parameters">
83+
> [!IMPORTANT]
84+
> The WAF-aligned configuration is under active development. More Azure Well-Architected recommendations will be added in future updates.
9385
94-
1. **Tenant ID** - The Azure Active Directory (AAD) tenant ID. This is used for authenticating against Azure resources. Copy this from the Azure portal.
95-
Example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
86+
## Deployment Steps
9687

97-
2. **Subscription ID** - The Azure subscription ID where resources will be deployed.
98-
Copy this from the Azure portal.
88+
Consider the following settings during your deployment to modify specific settings:
9989

100-
3. **Environment Name** - A unique environment name (e.g., dev, test, prod).
101-
This is used to scope resource names and group deployments logically.
90+
<details>
91+
<summary><b>Configurable Deployment Settings</b></summary>
10292

103-
4. **Resource Group Name** - The Azure resource group to deploy resources into.
104-
You may either:
93+
When you start the deployment, most parameters will have **default values**, but you can update the following settings [here](../docs/CustomizingAzdParameters.md):
10594

106-
- Specify an existing resource group to reuse it, [see below](#configuring-a-new-or-existing-resource-group) for more details, or
107-
- Leave blank to auto-generate a new name.
95+
| **Setting** | **Description** | **Default value** |
96+
| ------------------------------ | ------------------------------------------------------------------------------------ | ----------------- |
97+
| **Environment Name** | Used as a prefix for all resource names to ensure uniqueness across environments. | dkm |
98+
| **Azure Region** | Location of the Azure resources. Controls where the infrastructure will be deployed. | australiaeast |
99+
| **Model Deployment Type** | Defines the deployment type for the AI model (e.g., Standard, GlobalStandard). | GlobalStandard |
100+
| **GPT Model Name** | Specifies the name of the GPT model to be deployed. | gpt-4.1 |
101+
| **GPT Model Version** | Version of the GPT model to be used for deployment. | 2024-08-06 |
102+
| **GPT Model Capacity** | Sets the GPT model capacity. | 100K |
103+
| **Embedding Model** | Default: **text-embedding-ada-002**. | text-embedding-3-large |
104+
| **Embedding Model Capacity** | Set the capacity for **embedding models** (in thousands). | 200k |
105+
| **Enable Telemetry** | Enables telemetry for monitoring and diagnostics. | true |
106+
| **Existing Log Analytics Workspace** | To reuse an existing Log Analytics Workspace ID instead of creating a new one. | *(none)* |
108107

109-
5. **Location** - Azure data center where resources will be deployed.
108+
</details>
110109

111-
* Please [check Azure resource availability and note hardcoded regions](#regional-availability). The following locations are currently supported:
112-
113-
```
114-
'EastUS', 'EastUS2', 'WestUS', 'WestUS2', 'WestUS3', 'CentralUS', 'NorthCentralUS', 'SouthCentralUS','WestEurope', 'NorthEurope', 'SoutheastAsia', 'EastAsia', 'JapanEast', 'JapanWest', 'AustraliaEast', 'AustraliaSoutheast', 'CentralIndia', 'SouthIndia', 'CanadaCentral','CanadaEast', 'UKSouth', 'UKWest', 'FranceCentral', 'FranceSouth', 'KoreaCentral','KoreaSouth', 'GermanyWestCentral', 'GermanyNorth', 'NorwayWest', 'NorwayEast', 'SwitzerlandNorth', 'SwitzerlandWest', 'UAENorth', 'UAECentral', 'SouthAfricaNorth','SouthAfricaWest', 'BrazilSouth','BrazilSoutheast', 'QatarCentral', 'ChinaNorth', 'ChinaEast', 'ChinaNorth2', 'ChinaEast2'
110+
### Deploying with AZD
111+
112+
Once you've opened the project in [Codespaces](#github-codespaces), [Dev Containers](#vs-code-dev-containers), or [locally](#local-environment), you can deploy it to Azure by following these steps:
113+
114+
1. Clone the repository or download the project code via command-line:
115+
116+
```cmd
117+
git clone https://github.com/microsoft/Document-Knowledge-Mining-Solution-Accelerator
115118
```
116-
6. **ModelLocation** - Azure data center where GPT model will be deployed.
117-
The following locations are currently available :
119+
120+
Open the cloned repository in Visual Studio Code and connect to the development container.
121+
122+
```cmd
123+
code .
118124
```
119-
'WestUS3', 'EastUS', 'EastUS2', 'SwedenCentral'
125+
126+
2. Login to Azure:
127+
128+
```shell
129+
azd auth login
120130
```
121131
122-
7. **Email** - used for issuing certificates in Kubernetes clusters from the [Let's Encrypt](https://letsencrypt.org/) service. Email address should be valid.
132+
#### To authenticate with Azure Developer CLI (`azd`), use the following command with your **Tenant ID**:
123133
124-
8. **GO !** - Deployment Script executes Azure deployment, Azure Infrastructure configuration, Application code compile and publish into Kubernetes Cluster.
134+
```sh
135+
azd auth login --tenant-id <tenant-id>
136+
```
125137
126-
## Configuring a New or Existing Resource Group
138+
3. Provision and deploy all the resources:
127139
128-
➕ Creating a New Resource Group
140+
```shell
141+
azd up
142+
```
129143
130-
You have two options:
144+
4. Provide an `azd` environment name (e.g., "ckmapp").
145+
5. Select a subscription from your Azure account and choose a location that has quota for all the resources.
146+
-- This deployment will take *7-10 minutes* to provision the resources in your account and set up the solution with sample data.
147+
- If you encounter an error or timeout during deployment, changing the location may help, as there could be availability constraints for the resources.
131148
132-
- Manually specify a resource group name (e.g., rg-myproject-dev)
149+
6. If you are done trying out the application, you can delete the resources by running `azd down`.
133150
134-
- Leave the input field blank — a new name will be auto-generated by the script
151+
### Post Deployment Script:
135152
136-
🔁 Using an Existing Resource Group
153+
The post deployment process is very straightforward and simplified via a single [deployment script](../Deployment/resourcedeployment.ps1) that completes in approximately 20-30 minutes:
137154
138-
If reusing an existing Azure Resource Group:
155+
### Automated Deployment Steps:
156+
1. Configure Kubernetes Infrastructure.
157+
2. Update Kubernetes configuration files with the FQDN, Container Image Path and Email address for the certificate management.
158+
3. Configure AKS (deploy Cert Manager, Ingress Controller) and Deploy Images on the kubernetes cluster.
159+
4. Docker build and push container images to Azure Container Registry.
160+
5. Display the deployment result and following instructions.
161+
162+
Open PowerShell, change directory where you code cloned, then run the deploy script:
139163
140-
- Provide the exact name of the existing resource group
164+
```
165+
cd .\Deployment\
166+
```
167+
```
168+
.\resourcedeployment.ps1
169+
```
141170
142-
- Ensure the environment name matches the original environment used for that resource group
171+
If you run into issue with PowerShell script file not being digitally signed, you can execute below command:
143172
144-
⚠️ After deployment, please restart the AKS (Kubernetes) service to ensure updated configurations are applied when using a reused resource group.
173+
```
174+
powershell.exe -ExecutionPolicy Bypass -File ".\resourcedeployment.ps1"
175+
```
145176
177+
You will be prompted for the following parameters with this Screen :
178+
<img src="./images/deployment/Deployment_Input_Param_01.png" width="900" alt-text="Input Parameters">
146179
180+
1. **Email** - used for issuing certificates in Kubernetes clusters from the [Let's Encrypt](https://letsencrypt.org/) service. Email address should be valid.
147181
148-
<!-- 1. **Data File Upload and Processing** - Once the deployment finished, The Sample Data File upload and Document processing starts. -->
182+
<img src="./images/deployment/Deployment_Login_02.png" width="900" alt-text="Login">
183+
2. You will be prompted to Login, Select a account and proceed to Login.
184+
3. **GO !** - Post Deployment Script executes Azure Infrastructure configuration, Application code compile and publish into Kubernetes Cluster.
149185
150186
### Manual Deployment Steps:
151187
**Create Content Filter** - Please follow below steps
@@ -177,7 +213,7 @@ Don't miss this Url information. This is the application's endpoint URL and it s
177213
178214
| Model Name | TPM Threshold |
179215
|------------------------|---------------|
180-
| GPT-4o-mini | 100K TPM |
216+
| GPT-4.1-mini | 100K TPM |
181217
| text-embedding-3-large | 200K TPM |
182218
183219
@@ -201,3 +237,9 @@ Execute uploadfiles.ps1 file with **-EndpointUrl** parameter as URL in console m
201237
```
202238
.\uploadfiles.ps1 -EndpointUrl https://kmgs<your dns name>.<datacenter>.cloudapp.azure.com
203239
```
240+
241+
If you run into issue with PowerShell script file not being digitally signed, you can execute below command:
242+
243+
```
244+
powershell.exe -ExecutionPolicy Bypass -File ".\uploadfiles.ps1" -EndpointUrl https://kmgs<your dns name>.<datacenter>.cloudapp.azure.com
245+
```
31.5 KB
Loading
121 KB
Loading

0 commit comments

Comments
 (0)