Skip to content

Commit 2b0c3b2

Browse files
Resolved the comments
1 parent 6f03e11 commit 2b0c3b2

2 files changed

Lines changed: 76 additions & 121 deletions

File tree

Deployment/appconfig/aiservice/appsettings.Development.json.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
},
88
"AllowedHosts": "*",
99
"ConnectionStrings": {
10-
"AppConfig": "{{ appconfig-url }}"
10+
// Replace with the Azure App Configuration endpoint URL
11+
"AppConfig": "https://<app-config-name>.azconfig.io"
1112
}
1213
}
1314

docs/LocalDevelopmentSetup.md

Lines changed: 74 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Local Development Setup Guide
22

3-
This guide provides comprehensive instructions for setting up the Document Knowledge Mining Solution Accelerator for local development across Windows, Linux, and macOS platforms.
3+
This guide provides comprehensive instructions for setting up the Document Knowledge Mining Solution Accelerator for local development on Windows.
44

55
## Important Setup Notes
66

@@ -62,11 +62,10 @@ Document-Knowledge-Mining-Solution-Accelerator/ ← Repository root (star
6262

6363
```bash
6464
# Verify you're in the correct location
65-
pwd # Linux/macOS - should show: .../Document-Knowledge-Mining-Solution-Accelerator
6665
Get-Location # Windows PowerShell - should show: ...\Document-Knowledge-Mining-Solution-Accelerator
6766

6867
# If not, navigate to repository root
69-
cd path/to/Document-Knowledge-Mining-Solution-Accelerator
68+
cd path\to\Document-Knowledge-Mining-Solution-Accelerator
7069
```
7170

7271
### Configuration Files
@@ -123,47 +122,6 @@ az --version
123122
node -v
124123
yarn --version
125124
```
126-
### Linux Development
127-
128-
#### Ubuntu/Debian
129-
```bash
130-
# .NET SDK (LTS .NET 8)
131-
sudo apt update && sudo apt install -y dotnet-sdk-8.0
132-
133-
# Azure CLI (required for authentication and resource management)
134-
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
135-
136-
# Yarn (via Corepack) – install Node.js LTS first
137-
sudo apt install -y nodejs npm
138-
corepack enable
139-
corepack prepare yarn@stable --activate
140-
141-
# Verify
142-
dotnet --version
143-
az --version
144-
yarn --version
145-
```
146-
147-
#### RHEL/CentOS/Fedora
148-
```bash
149-
# .NET SDK (LTS .NET 8)
150-
sudo dnf install -y dotnet-sdk-8.0
151-
152-
# Azure CLI (required for authentication and resource management)
153-
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
154-
sudo dnf install -y https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm
155-
sudo dnf install -y azure-cli
156-
157-
# Yarn (via Corepack) – install Node.js LTS first
158-
sudo dnf install -y nodejs npm
159-
corepack enable
160-
corepack prepare yarn@stable --activate
161-
162-
# Verify
163-
dotnet --version
164-
az --version
165-
yarn --version
166-
```
167125
### Clone the Repository
168126

169127
```bash
@@ -203,11 +161,21 @@ For reference, see the image below:
203161

204162
To run the application locally, your Azure account needs the following role assignments on the deployed resources:
205163

206-
#### App Configuration Access
164+
> **Note:**
165+
> These roles are required only for local debugging and development. For production, ensure proper RBAC policies are applied.
166+
167+
You can assign these roles using either Azure CLI (Option 1) or Azure Portal (Option 2).
168+
169+
#### Option 1: Assign Roles via Azure CLI
170+
207171
```bash
208172
# Get your principal ID
209173
PRINCIPAL_ID=$(az ad signed-in-user show --query id -o tsv)
174+
```
210175

176+
**App Configuration Data Reader** – Required for reading application configuration
177+
178+
```bash
211179
# Assign App Configuration Data Reader role
212180
az role assignment create \
213181
--assignee $PRINCIPAL_ID \
@@ -278,6 +246,41 @@ az role assignment create \
278246
--scope "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.CognitiveServices/accounts/<document-intelligence-service-name>"
279247
```
280248

249+
#### Option 2: Assign Roles via Azure Portal
250+
251+
If you prefer or need to use the Azure Portal instead of CLI commands:
252+
253+
1. Sign in to the [Azure Portal](https://portal.azure.com).
254+
2. Navigate to your **Resource Group** where services are deployed.
255+
3. For each resource, assign the required roles:
256+
257+
**App Configuration**
258+
- Go to **Access control (IAM)****Add role assignment**
259+
- Assign role: `App Configuration Data Reader`
260+
- Assign to: Your user account
261+
262+
**Storage Account**
263+
- Go to **Access control (IAM)****Add role assignment**
264+
- Assign the following roles to your user account:
265+
- `Storage Blob Data Contributor`
266+
- `Storage Queue Data Contributor`
267+
268+
**Azure AI Search**
269+
- Go to **Access control (IAM)****Add role assignment**
270+
- Assign the following roles to your user account:
271+
- `Search Index Data Contributor`
272+
- `Search Service Contributor`
273+
274+
**Azure OpenAI**
275+
- Go to **Access control (IAM)****Add role assignment**
276+
- Assign role: `Cognitive Services OpenAI User`
277+
- Assign to: Your user account
278+
279+
**Azure AI Document Intelligence**
280+
- Go to **Access control (IAM)****Add role assignment**
281+
- Assign role: `Cognitive Services User`
282+
- Assign to: Your user account
283+
281284
**Note**: RBAC permission changes can take 5-10 minutes to propagate. If you encounter "Forbidden" errors after assigning roles, wait a few minutes and try again.
282285

283286
## Step 3: Backend Setup & Run Instructions
@@ -309,8 +312,6 @@ Navigate to the cloned repository and open the following solution files from Vis
309312
cd "Document-Knowledge-Mining-Solution-Accelerator"
310313

311314
# Copy the template file
312-
cp Deployment/appconfig/kernelmemory/appsettings.Development.json.template App/kernel-memory/service/Service/appsettings.Development.json # Linux
313-
# or
314315
Copy-Item Deployment\appconfig\kernelmemory\appsettings.Development.json.template App\kernel-memory\service\Service\appsettings.Development.json # Windows PowerShell
315316
```
316317

@@ -334,9 +335,7 @@ Copy-Item Deployment\appconfig\kernelmemory\appsettings.Development.json.templat
334335
cd "Document-Knowledge-Mining-Solution-Accelerator"
335336

336337
# Copy the template file
337-
cp Deployment/appconfig/aiservice/appsettings.Development.json.template App/backend-api/Microsoft.GS.DPS.Host/appsettings.Development.json # Linux
338-
# or
339-
Copy-Item Deployment\appconfig\aiservice\appsettings.Development.json.template App\backend-api\Microsoft.GS.DPS.Host\appsettings.Development.json # Windows PowerShell
338+
Copy-Item Deployment\appconfig\aiservice\appsettings.Development.json.template App\backend-api\Microsoft.GS.DPS.Host\appsettings.Development.json
340339
```
341340

342341
4. Edit the `appsettings.Development.json` file with your Azure App Configuration URL:
@@ -351,59 +350,17 @@ Copy-Item Deployment\appconfig\aiservice\appsettings.Development.json.template A
351350

352351
---
353352

354-
### 3.3. Set Startup Projects
353+
## Step 4: Run Backend Services
354+
355+
### 4.1. Set Startup Projects
355356

356357
- **KernelMemory Solution:**
357358
Set **Service** (located inside the `service` folder) as the startup project to run the Kernel Memory service.
358359

359360
- **Microsoft.GS.DPS Solution:**
360361
Set **Microsoft.GS.DPS.Host** as the startup project to run the API.
361362

362-
---
363-
364-
365-
### 3.4. Alternative: Assign Azure Roles via Portal (If CLI Commands Don't Work)
366-
367-
> **Note:**
368-
> If you were unable to assign roles using the Azure CLI commands in Step 2, you can use the Azure Portal as an alternative method.
369-
> These roles are required only for local debugging and development. For production, ensure proper RBAC policies are applied.
370-
371-
1. Sign in to the [Azure Portal](https://portal.azure.com).
372-
2. Navigate to your **Resource Group** where services are deployed.
373-
3. For each resource, assign the required roles:
374-
375-
#### App Configuration
376-
- Go to **Access control (IAM)****Add role assignment**
377-
- Assign role: `App Configuration Data Reader`
378-
- Assign to: Your user account
379-
380-
#### Storage Account
381-
- Go to **Access control (IAM)****Add role assignment**
382-
- Assign the following roles to your user account:
383-
- `Storage Blob Data Contributor`
384-
- `Storage Queue Data Contributor`
385-
386-
#### Azure AI Search
387-
- Go to **Access control (IAM)****Add role assignment**
388-
- Assign the following roles to your user account:
389-
- `Search Index Data Contributor`
390-
- `Search Service Contributor`
391-
392-
#### Azure OpenAI
393-
- Go to **Access control (IAM)****Add role assignment**
394-
- Assign role: `Cognitive Services OpenAI User`
395-
- Assign to: Your user account
396-
397-
#### Azure AI Document Intelligence
398-
- Go to **Access control (IAM)****Add role assignment**
399-
- Assign role: `Cognitive Services User`
400-
- Assign to: Your user account
401-
402-
**Remember**: RBAC permission changes can take 5-10 minutes to propagate.
403-
404-
---
405-
406-
### 3.5. Update Kernel Memory Endpoint in Azure App Configuration
363+
### 4.2. Update Kernel Memory Endpoint in Azure App Configuration
407364

408365
> **Important:**
409366
> The following change is only for local development and debugging.
@@ -424,20 +381,27 @@ Copy-Item Deployment\appconfig\aiservice\appsettings.Development.json.template A
424381
```
425382
6. Apply the changes.
426383
427-
---
428-
**After running both solutions, two terminal windows will appear. Once the backend starts successfully, Swagger will start at http://localhost:9001. You can now validate the API endpoints from the Swagger UI to ensure that the backend is running correctly.**
429-
430384
> **Note:**
431385
> Always revert the Kernel Memory endpoint value back to `http://kernelmemory-service` before running the application in Azure.
432386
433-
---
387+
### 4.3. Run the Backend Services
388+
389+
1. In Visual Studio, run both solutions (KernelMemory and Microsoft.GS.DPS) by pressing **F5** or clicking the **Start** button.
390+
2. Two terminal windows will appear showing the service logs.
391+
3. Once both services start successfully:
392+
- **Kernel Memory Service** will be available at: http://localhost:9001
393+
- **Backend API** will be available at: https://localhost:52190
394+
- **Swagger UI** will open automatically at http://localhost:52190 for API validation
395+
396+
> **⚠️ Important:** Keep both terminal windows open while the services are running. Do not close them until you're done with development.
434397
398+
---
435399
436-
## Step 4: Frontend Setup & Run Instructions
400+
## Step 5: Frontend Setup & Run Instructions
437401
438-
### 4.1. Open the repo in **VS Code**.
402+
### 5.1. Open the repo in **VS Code**.
439403
440-
### 4.2. Create `.env` file from template
404+
### 5.2. Create `.env` file from template
441405
442406
Navigate to the `App/frontend-app` folder and create the `.env` file:
443407
@@ -446,12 +410,10 @@ Navigate to the `App/frontend-app` folder and create the `.env` file:
446410
cd "Document-Knowledge-Mining-Solution-Accelerator"
447411
448412
# Copy the template file
449-
cp Deployment/appconfig/frontapp/.env.template App/frontend-app/.env # Linux
450-
# or
451-
Copy-Item Deployment\appconfig\frontapp\.env.template App\frontend-app\.env # Windows PowerShell
413+
Copy-Item Deployment\appconfig\frontapp\.env.template App\frontend-app\.env
452414
```
453415

454-
### 4.3. Configure the `.env` file
416+
### 5.3. Configure the `.env` file
455417

456418
Update the `VITE_API_ENDPOINT` value with your local Backend API URL:
457419

@@ -460,7 +422,7 @@ VITE_API_ENDPOINT=https://localhost:52190
460422
DISABLE_AUTH=true
461423
VITE_ENABLE_UPLOAD_BUTTON=true
462424
```
463-
### 4.4. Verify Node.js and Yarn Installation
425+
### 5.4. Verify Node.js and Yarn Installation
464426

465427
Before installing dependencies, verify that Node.js (LTS) and Yarn are already installed from Step 1:
466428

@@ -475,17 +437,17 @@ yarn -v
475437
> corepack prepare yarn@stable --activate
476438
> ```
477439
478-
### 4.5. Install frontend dependencies
440+
### 5.5. Install frontend dependencies
479441
480-
```bash
442+
```powershell
481443
# From repository root, navigate to frontend directory
482-
cd App/frontend-app
444+
cd App\frontend-app
483445
484446
# Install dependencies
485447
yarn install
486448
```
487449
488-
### 4.6. Start the application
450+
### 5.6. Start the application
489451

490452
```powershell
491453
yarn start
@@ -511,13 +473,6 @@ You're now ready to run and debug the application locally!
511473
- While running the Kernel solution, if you encounter an error such as ``server not responded`` or ``server not found``, it usually indicates that the required resource is not responding.
512474
- Ensure that the necessary **Kubernetes services** are running. If not, start the Kubernetes service and then run the Kernel solution again.
513475

514-
#### Permission Issues (Linux/macOS)
515-
516-
```bash
517-
# Fix ownership of files
518-
sudo chown -R $USER:$USER .
519-
```
520-
521476
#### Windows-Specific Issues
522477

523478
```powershell
@@ -545,7 +500,6 @@ az account show
545500

546501
```bash
547502
# Check environment variables are loaded
548-
env | grep AZURE # Linux/macOS
549503
Get-ChildItem Env:AZURE* # Windows PowerShell
550504

551505
# Validate .env file format

0 commit comments

Comments
 (0)