|
| 1 | +# Local Setup Guide |
| 2 | + |
| 3 | +Follow these steps to set up and debug the application locally. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Backend Setup |
| 8 | + |
| 9 | +### 1. Clone the Repository |
| 10 | + |
| 11 | +```powershell |
| 12 | +git clone https://github.com/microsoft/Document-Knowledge-Mining-Solution-Accelerator.git |
| 13 | +``` |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +### 2. Sign In to Visual Studio |
| 18 | + |
| 19 | +- Open the **KernelMemory** and **Microsoft.GS.DPS** solutions in Visual Studio. |
| 20 | +- Sign in using your tenant account with the required permissions. |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +### 3. Verify `appsettings.Development.json` |
| 25 | + |
| 26 | +After deploying the accelerator, the `appsettings.Development.json` file will be created automatically. |
| 27 | + |
| 28 | +- **KernelMemory Solution:** |
| 29 | + Expand the `appsettings.json` file under the **Service** project (inside the `service` folder) and confirm that `appsettings.Development.json` exists. |
| 30 | + |
| 31 | +- **Microsoft.GS.DPS Solution:** |
| 32 | + Expand the `appsettings.json` file under the **Microsoft.GS.DPS.Host** project and confirm that `appsettings.Development.json` exists. |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +### 4. Set Startup Projects |
| 37 | + |
| 38 | +- **KernelMemory Solution:** |
| 39 | + Set **Service** (located inside the `service` folder) as the startup project to run the Kernel Memory service. |
| 40 | + |
| 41 | +- **Microsoft.GS.DPS Solution:** |
| 42 | + Set **Microsoft.GS.DPS.Host** as the startup project to run the API. |
| 43 | + |
| 44 | +--- |
| 45 | + |
| 46 | +### 5. Assign Required Azure Roles |
| 47 | + |
| 48 | +To enable local debugging and ensure your application can access necessary Azure resources, assign the following roles to your Microsoft Entra ID in the respective services within your deployed resource group in the Azure portal: |
| 49 | + |
| 50 | +- **App Configuration** |
| 51 | + - App Configuration Data Reader |
| 52 | +- **Storage Account** |
| 53 | + - Storage Blob Data Contributor |
| 54 | + - Storage Queue Data Contributor |
| 55 | + - Storage Blob Data Reader |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +### 6. Update Kernel Memory Endpoint in Azure App Configuration |
| 60 | + |
| 61 | +> **Important:** |
| 62 | +> The following change is only for local development and debugging. |
| 63 | +> For production or Azure deployment, ensure the endpoint is set to `http://kernelmemory-service` to avoid misconfiguration. |
| 64 | +
|
| 65 | +1. Sign in to the [Azure Portal](https://portal.azure.com). |
| 66 | +2. Navigate to your **App Configuration** resource within/from your deployed resource group. |
| 67 | +3. Go to **Operations → Configuration Explorer**. |
| 68 | +4. Search for the key: |
| 69 | + `Application:Services:KernelMemory:Endpoint` |
| 70 | +5. For local development, update its value from: |
| 71 | + ``` |
| 72 | + http://kernelmemory-service |
| 73 | + ``` |
| 74 | + to |
| 75 | + ``` |
| 76 | + http://localhost:9001 |
| 77 | + ``` |
| 78 | +6. Apply the changes. |
| 79 | +
|
| 80 | +> **Note:** |
| 81 | +> Always revert this value back to `http://kernelmemory-service` before running the application in Azure. |
| 82 | +
|
| 83 | +--- |
| 84 | +
|
| 85 | +## Frontend Setup |
| 86 | +
|
| 87 | +1. Open the repo in **VS Code**. |
| 88 | +2. Navigate to the `App/frontend-app` folder and locate the `.env` file. |
| 89 | +3. In the `.env` file, update the `VITE_API_ENDPOINT` value with your local API URL, e.g.: |
| 90 | + ``` |
| 91 | + VITE_API_ENDPOINT=https://localhost:52190 |
| 92 | + ``` |
| 93 | +4. Install dependencies: |
| 94 | + ```powershell |
| 95 | + yarn install |
| 96 | + ``` |
| 97 | +5. Start the application: |
| 98 | + ```powershell |
| 99 | + yarn start |
| 100 | + ``` |
| 101 | +
|
| 102 | +--- |
| 103 | +
|
| 104 | +**You're now ready to run and debug the application locally!** |
0 commit comments