|
| 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](./DeploymentGuide.md). |
| 4 | +
|
| 5 | +--- |
| 6 | + |
| 7 | +This document provides guidance on post-deployment steps after deploying the Document Knowledge Mining Solution Accelerator from the [AVM (Azure Verified Modules) repository](https://github.com/Azure/bicep-registry-modules/tree/main/avm/ptn/sa/document-knowledge-mining). |
| 8 | + |
| 9 | +## Overview |
| 10 | + |
| 11 | +After deploying the infrastructure using AVM, you'll need to complete the application layer setup, which includes: |
| 12 | +- Configuring Kubernetes infrastructure |
| 13 | +- Building and deploying container images |
| 14 | +- Setting up certificates and ingress controllers |
| 15 | +- Configuring application settings |
| 16 | + |
| 17 | +## Prerequisites |
| 18 | + |
| 19 | +Before starting the post-deployment process, ensure you have the following: |
| 20 | + |
| 21 | +### Required Software |
| 22 | + |
| 23 | +1. **[PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.4)** <small>(v7.0+ recommended, v5.1+ minimum)</small> - Available for Windows, macOS, and Linux |
| 24 | + |
| 25 | +2. **[Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli)** <small>(v2.50+)</small> - Command-line tool for managing Azure resources |
| 26 | + |
| 27 | +3. **kubectl** - Kubernetes command-line tool |
| 28 | + Install using Azure CLI: |
| 29 | + ```powershell |
| 30 | + az aks install-cli |
| 31 | + ``` |
| 32 | + |
| 33 | +4. **aks-preview extension** - Azure CLI extension for AKS preview features |
| 34 | + ```powershell |
| 35 | + az extension add --name aks-preview |
| 36 | + ``` |
| 37 | + |
| 38 | +5. **[Helm](https://helm.sh/docs/intro/install/)** <small>(v3.0+)</small> - Package manager for Kubernetes |
| 39 | + |
| 40 | +6. **[Docker Desktop](https://docs.docker.com/get-docker/)** - Container platform for building and publishing images |
| 41 | + > ⚠️ **Important**: Ensure Docker Desktop is running before executing the deployment script |
| 42 | +
|
| 43 | +### Azure Requirements |
| 44 | + |
| 45 | +7. **Azure Access** - One of the following roles on the subscription: |
| 46 | + - `Owner` |
| 47 | + - `User Access Administrator` |
| 48 | + |
| 49 | +8. **Microsoft.Compute Registration** - Verify this resource provider is registered: |
| 50 | + 1. Navigate to [Azure Portal](https://portal.azure.com) |
| 51 | + 2. Go to your **Azure subscription** |
| 52 | + 3. Select **Settings** → **Resource Providers** |
| 53 | + 4. Search for **Microsoft.Compute** and ensure it's **Registered** |
| 54 | + |
| 55 | + <img src="./images/deployment/Subscription_ResourceProvider.png" alt="Resource Provider Registration" width="900"> |
| 56 | + |
| 57 | +9. **Deployed Infrastructure** - A successful Document Knowledge Mining Accelerator deployment from the [AVM repository](https://github.com/Azure/bicep-registry-modules/tree/main/avm/ptn/sa/document-knowledge-mining) |
| 58 | + |
| 59 | +## Post-Deployment Steps |
| 60 | + |
| 61 | +### Step 1: Clone the Repository |
| 62 | + |
| 63 | +First, clone this repository to access the post-deployment scripts: |
| 64 | + |
| 65 | +```powershell |
| 66 | +git clone https://github.com/microsoft/Document-Knowledge-Mining-Solution-Accelerator.git |
| 67 | +``` |
| 68 | +```powershell |
| 69 | +cd Document-Knowledge-Mining-Solution-Accelerator |
| 70 | +``` |
| 71 | + |
| 72 | +### Step 2: Run the Post-Deployment Script |
| 73 | + |
| 74 | +The post-deployment process is automated through a single PowerShell script that completes the following tasks in approximately 20-30 minutes: |
| 75 | + |
| 76 | +#### What the Script Does: |
| 77 | +1. **Configure Kubernetes Infrastructure** - Set up AKS cluster settings and networking |
| 78 | +2. **Update Configuration Files** - Generate FQDN, container image paths, and certificate settings |
| 79 | +3. **Deploy Kubernetes Components** - Install Cert Manager, Ingress Controller, and application pods |
| 80 | +4. **Build and Push Container Images** - Compile and publish application containers to Azure Container Registry |
| 81 | +5. **Provide Access Information** - Display the final application URL and next steps |
| 82 | + |
| 83 | +#### Execute the Script: |
| 84 | + |
| 85 | +1. Navigate to the deployment directory: |
| 86 | + ```powershell |
| 87 | + cd .\Deployment\ |
| 88 | + ``` |
| 89 | + |
| 90 | +2. **Choose the appropriate command based on your deployment method:** |
| 91 | + |
| 92 | + **If you deployed using custom templates, ARM/Bicep deployments, or `az deployment group` commands:** |
| 93 | + ```powershell |
| 94 | + .\resourcedeployment.ps1 -ResourceGroupName "<your-resource-group-name>" |
| 95 | + ``` |
| 96 | + |
| 97 | + **If you deployed using `azd up` command:** |
| 98 | + ```powershell |
| 99 | + .\resourcedeployment.ps1 |
| 100 | + ``` |
| 101 | + |
| 102 | + > **Note**: Replace `<your-resource-group-name>` with the actual name of the resource group containing your deployed Azure resources. |
| 103 | +
|
| 104 | + > **💡 Tip**: Since this guide is for AVM deployments, you'll most likely use the first command with the `-ResourceGroupName` parameter. |
| 105 | +
|
| 106 | +3. **If you encounter execution policy issues**, use this alternative command: |
| 107 | + ```powershell |
| 108 | + powershell.exe -ExecutionPolicy Bypass -File ".\resourcedeployment.ps1" -ResourceGroupName "<your-resource-group-name>" |
| 109 | + ``` |
| 110 | + |
| 111 | +### Step 3: Provide Required Information |
| 112 | + |
| 113 | +During script execution, you'll be prompted for: |
| 114 | + |
| 115 | +#### Email Address for SSL Certificates |
| 116 | +<img src="./images/deployment/Deployment_Input_Param_01.png" width="900" alt="Input Parameters"> |
| 117 | + |
| 118 | +- **Purpose**: Used for issuing SSL certificates through [Let's Encrypt](https://letsencrypt.org/) |
| 119 | +- **Requirement**: Must be a valid email address |
| 120 | + |
| 121 | +#### Azure Authentication |
| 122 | +<img src="./images/deployment/Deployment_Login_02.png" width="900" alt="Azure Login"> |
| 123 | + |
| 124 | +- You'll be prompted to authenticate with Azure |
| 125 | +- Select the appropriate Azure account |
| 126 | +- Ensure you have the required permissions on the target subscription |
| 127 | + |
| 128 | +### Step 4: Deployment Completion |
| 129 | + |
| 130 | +Upon successful completion, you'll see a success message with important information: |
| 131 | + |
| 132 | +<img src="./images/deployment/Deployment_Screen02.png" alt="Deployment Success" width="900"> |
| 133 | + |
| 134 | +**🎉 Congratulations!** Your deployment is complete. |
| 135 | + |
| 136 | +**Important**: Save the application URL displayed in the console - you'll need it for data upload and accessing the application. |
| 137 | + |
| 138 | +## Next Steps |
| 139 | + |
| 140 | +### 1. Configure Azure OpenAI Rate Limits |
| 141 | + |
| 142 | +> **⚠️ Critical**: The default deployment creates models with minimal TPM (Tokens Per Minute) limits. You **must** increase these limits for proper performance. |
| 143 | +
|
| 144 | +#### Recommended TPM Thresholds |
| 145 | + |
| 146 | +| Model Name | Recommended TPM | Minimum TPM | |
| 147 | +|------------------------|----------------|-------------| |
| 148 | +| gpt-4.1-mini | 100K TPM | 10K TPM | |
| 149 | +| text-embedding-3-large | 200K TPM | 50K TPM | |
| 150 | + |
| 151 | +> **⚠️ Warning**: Insufficient quota will cause failures during document upload and processing. Ensure adequate capacity before proceeding. |
| 152 | +
|
| 153 | +#### How to Update TPM Limits: |
| 154 | + |
| 155 | +1. **Navigate to Azure AI Foundry**: |
| 156 | + - Go to [Azure AI Foundry](https://ai.azure.com/) |
| 157 | + - Select your project |
| 158 | + - Go to **Deployments** section |
| 159 | + |
| 160 | +2. **Update Each Model**: |
| 161 | + |
| 162 | + <img src="./images/deployment/Control_Model_TPM000.png" alt="Select Model" width="700"> |
| 163 | + |
| 164 | + - Select each deployed model |
| 165 | + - Click **Edit deployment** |
| 166 | + - Increase the **Tokens per Minute Rate Limit** |
| 167 | + |
| 168 | + <img src="./images/deployment/Control_Model_TPM001.png" alt="Set TPM Limit" width="700"> |
| 169 | + |
| 170 | +3. **Apply Changes**: Save the configuration for each model |
| 171 | + |
| 172 | +### 2. Upload and Process Sample Documents |
| 173 | + |
| 174 | +After configuring the TPM limits, upload sample documents: |
| 175 | + |
| 176 | +1. **Navigate to the deployment directory** (if not already there): |
| 177 | + ```powershell |
| 178 | + cd .\Deployment\ |
| 179 | + ``` |
| 180 | + |
| 181 | +2. **Execute the upload script** with the URL from the deployment output: |
| 182 | + ```powershell |
| 183 | + .\uploadfiles.ps1 -EndpointUrl https://kmgs<your-dns-name>.<datacenter>.cloudapp.azure.com |
| 184 | + ``` |
| 185 | + |
| 186 | +3. **Alternative execution** (if you encounter policy issues): |
| 187 | + ```powershell |
| 188 | + powershell.exe -ExecutionPolicy Bypass -File ".\uploadfiles.ps1" -EndpointUrl https://kmgs<your-dns-name>.<datacenter>.cloudapp.azure.com |
| 189 | + ``` |
| 190 | + |
| 191 | +### 3. Access Your Application |
| 192 | + |
| 193 | +Once document upload is complete, you can: |
| 194 | +- **Access the web application** at the URL provided in the deployment output |
| 195 | +- **Start exploring** the knowledge mining capabilities |
| 196 | +- **Upload additional documents** through the web interface |
0 commit comments