Skip to content

Commit e8007cb

Browse files
Updated the local setup guide
1 parent 6377133 commit e8007cb

File tree

7 files changed

+257
-13
lines changed

7 files changed

+257
-13
lines changed

docs/DeleteResourceGroup.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Deleting Resources After a Failed Deployment in Azure Portal
2+
3+
If your deployment fails and you need to clean up the resources manually, follow these steps in the Azure Portal.
4+
5+
---
6+
7+
## **1. Navigate to the Azure Portal**
8+
1. Open [Azure Portal](https://portal.azure.com/).
9+
2. Sign in with your Azure account.
10+
11+
---
12+
13+
## **2. Find the Resource Group**
14+
1. In the search bar at the top, type **"Resource groups"** and select it.
15+
2. Locate the **resource group** associated with the failed deployment.
16+
17+
![Resource Groups](images/resourcegroup.png)
18+
19+
![Resource Groups](images/resource-groups.png)
20+
21+
---
22+
23+
## **3. Delete the Resource Group**
24+
1. Click on the **resource group name** to open it.
25+
2. Click the **Delete resource group** button at the top.
26+
27+
![Delete Resource Group](images/DeleteRG.png)
28+
29+
3. Type the resource group name in the confirmation box and click **Delete**.
30+
31+
📌 **Note:** Deleting a resource group will remove all resources inside it.
32+
33+
---
34+
35+
## **4. Delete Individual Resources (If Needed)**
36+
If you don’t want to delete the entire resource group, follow these steps:
37+
38+
1. Open **Azure Portal** and go to the **Resource groups** section.
39+
2. Click on the specific **resource group**.
40+
3. Select the **resource** you want to delete (e.g., App Service, Storage Account).
41+
4. Click **Delete** at the top.
42+
43+
![Delete Individual Resource](images/deleteservices.png)
44+
45+
---
46+
47+
## **5. Verify Deletion**
48+
- After a few minutes, refresh the **Resource groups** page.
49+
- Ensure the deleted resource or group no longer appears.
50+
51+
📌 **Tip:** If a resource fails to delete, check if it's **locked** under the **Locks** section and remove the lock.
52+
53+

docs/LocalSetupGuide.md

Lines changed: 159 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,75 @@
11
# Local Setup Guide
22

3-
Follow these steps to set up and debug the application locally.
3+
This guide provides comprehensive instructions for setting up the Document Knowledge Mining Solution Accelerator for local development across Windows, Linux, and macOS platforms.
44

55
---
6+
## Step 1: Prerequisites - Install Required Tools
7+
Install these tools before you start:
8+
- [Visual Studio](https://visualstudio.microsoft.com/)
9+
- [Visual Studio Code](https://code.visualstudio.com/)
10+
- [Node.js (LTS)](https://nodejs.org/en).
611

7-
## Backend Setup
12+
### Windows Development
13+
```
14+
# .NET SDK (LTS .NET 8)
15+
winget install Microsoft.DotNet.SDK.8
16+
17+
# Yarn (via Corepack) – install Node.js LTS first
18+
winget install OpenJS.NodeJS.LTS
19+
corepack enable
20+
corepack prepare yarn@stable --activate
21+
22+
# Verify
23+
dotnet --version
24+
yarn --version
25+
```
26+
### Linux Development
27+
28+
#### Ubuntu/Debian
29+
```
30+
# .NET SDK (LTS .NET 8)
31+
sudo apt update && sudo apt install -y dotnet-sdk-8.0
32+
33+
# Yarn (via Corepack) – install Node.js LTS first
34+
sudo apt install -y nodejs npm
35+
corepack enable
36+
corepack prepare yarn@stable --activate
37+
38+
# Verify
39+
dotnet --version
40+
yarn --version
41+
```
42+
43+
#### RHEL/CentOS/Fedora
44+
```
45+
# .NET SDK (LTS .NET 8)
46+
sudo dnf install -y dotnet-sdk-8.0
47+
48+
# Yarn (via Corepack) – install Node.js LTS first
49+
sudo dnf install -y nodejs npm
50+
corepack enable
51+
corepack prepare yarn@stable --activate
52+
53+
# Verify
54+
dotnet --version
55+
yarn --version
56+
```
57+
### macOS Development
58+
```
59+
# .NET SDK (LTS .NET 8)
60+
brew install --cask dotnet-sdk
61+
62+
# Yarn (via Corepack) – install Node.js first
63+
brew install node
64+
corepack enable
65+
corepack prepare yarn@stable --activate
66+
67+
# Verify
68+
dotnet --version
69+
yarn --version
70+
```
71+
72+
## Step 2: Backend Setup
873

974
### 1. Clone the Repository
1075

@@ -15,9 +80,16 @@ git clone https://github.com/microsoft/Document-Knowledge-Mining-Solution-Accele
1580
---
1681

1782
### 2. Sign In to Visual Studio
83+
#### 1. Open Solutions in Visual Studio
84+
Navigate to the cloned repository and open the following solution files from Visual Studio:
85+
86+
- **KernelMemory**
87+
- Path: `Document-Knowledge-Mining-Solution-Accelerator/App/kernel-memory/KernelMemory.sln`
88+
89+
- **Microsoft.GS.DPS**
90+
- Path: `Document-Knowledge-Mining-Solution-Accelerator/App/backend-api/Microsoft.GS.DPS.sln`
1891

19-
- Open the **KernelMemory** and **Microsoft.GS.DPS** solutions in Visual Studio.
20-
- Sign in using your tenant account with the required permissions.
92+
#### 2. Sign in to Visual Studio using your **tenant account** with the required permissions.
2193

2294
---
2395

@@ -43,16 +115,25 @@ After deploying the accelerator, the `appsettings.Development.json` file will be
43115

44116
---
45117

118+
46119
### 5. Assign Required Azure Roles
47120

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:
121+
> **Important:**
122+
> These roles are required only for local debugging and development.
123+
> For production, ensure proper RBAC policies are applied.
49124
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
125+
1. Sign in to the [Azure Portal](https://portal.azure.com).
126+
2. Navigate to your **Resource Group** where services are deployed.
127+
3. Open the **App Configuration**:
128+
- Go to **Access control (IAM)****Add role assignment**.
129+
- Assign to:
130+
`App Configuration Data Reader`
131+
4. For **Storage Account**:
132+
- Go to **Access control (IAM)****Add role assignment**.
133+
- Assign to:
134+
- `Storage Blob Data Contributor`
135+
- `Storage Queue Data Contributor`
136+
- `Storage Blob Data Reader`
56137

57138
---
58139

@@ -77,12 +158,16 @@ To enable local debugging and ensure your application can access necessary Azure
77158
```
78159
6. Apply the changes.
79160
161+
---
162+
**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.**
163+
80164
> **Note:**
81165
> Always revert this value back to `http://kernelmemory-service` before running the application in Azure.
82166
83167
---
84168
85-
## Frontend Setup
169+
170+
## Step 3: Frontend Setup
86171
87172
1. Open the repo in **VS Code**.
88173
2. Navigate to the `App/frontend-app` folder and locate the `.env` file.
@@ -113,4 +198,65 @@ To enable local debugging and ensure your application can access necessary Azure
113198
114199
---
115200
116-
**You're now ready to run and debug the application locally!**
201+
**The application will start at https://localhost:52190. You’re now ready to run and debug the application locally!**
202+
203+
---
204+
205+
## Troubleshooting
206+
207+
### Common Issues
208+
209+
210+
#### Server Not Responded Issues
211+
212+
- 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.
213+
- Ensure that the necessary **Kubernetes services** are running. If not, start the Kubernetes service and then run the Kernel solution again.
214+
.
215+
216+
#### Permission Issues (Linux/macOS)
217+
218+
```bash
219+
# Fix ownership of files
220+
sudo chown -R $USER:$USER .
221+
```
222+
223+
#### Windows-Specific Issues
224+
225+
```powershell
226+
# PowerShell execution policy
227+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
228+
229+
# Long path support (Windows 10 1607+, run as Administrator)
230+
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
231+
```
232+
233+
### Azure Authentication Issues
234+
235+
```bash
236+
# Login to Azure CLI
237+
az login
238+
239+
# Set subscription
240+
az account set --subscription "your-subscription-id"
241+
242+
# Test authentication
243+
az account show
244+
```
245+
246+
### Environment Variable Issues
247+
248+
```bash
249+
# Check environment variables are loaded
250+
env | grep AZURE # Linux/macOS
251+
Get-ChildItem Env:AZURE* # Windows PowerShell
252+
253+
# Validate .env file format
254+
cat .env | grep -v '^#' | grep '=' # Should show key=value pairs
255+
```
256+
257+
## Related Documentation
258+
259+
- [Deployment Guide](DeploymentGuide.md) - Instructions for production deployment.
260+
- [Delete Resource Group](DeleteResourceGroup.md) - Steps to safely delete the Azure resource group created for the solution.
261+
- [Powershell Setup](PowershellSetup.md) - Instructions for setting up PowerShell and required scripts.
262+
- [Quota Check](QuotaCheck.md) - Steps to verify Azure quotas and ensure required limits before deployment.

docs/PowershellSetup.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Add PowerShell 7 to PATH in Windows
2+
3+
This guide will help you add **PowerShell 7** (PowerShell Core) to your system’s PATH variable on Windows, so you can easily run it from any Command Prompt or Run dialog.
4+
5+
## Prerequisites
6+
7+
- You should have **PowerShell 7** installed on your machine. If you haven’t installed it yet, you can download it following the guide here: [Installing PowerShell on Windows | Microsoft Learn](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5).
8+
- **Administrative privileges are not required** unless you're modifying system-wide environment variables. You can modify your **user-specific PATH** without admin rights.
9+
10+
## Steps to Add PowerShell 7 to PATH
11+
12+
### 1. Open **System Properties**
13+
- Press `Win + X` and choose **System**.
14+
- Click on **Advanced system settings** on the left sidebar. This will open the **System Properties** window.
15+
- In the **System Properties** window, click on the **Environment Variables** button at the bottom.
16+
17+
### 2. Edit User Environment Variables
18+
- In the **Environment Variables** window, under **User variables**, find the `Path` variable.
19+
- Select the `Path` variable and click **Edit**. (If the `Path` variable doesn’t exist, click **New** and name it `Path`.)
20+
21+
### 3. Check if PowerShell 7 Path is Already in PATH
22+
- Before adding the path, make sure the following path is not already present in the list:
23+
```
24+
C:\Program Files\PowerShell\7\
25+
```
26+
- If the path is already there, you don't need to add it again.
27+
### 4. Add PowerShell 7 Path
28+
- If the path is not already in the list, click **New** in the **Edit Environment Variable** window.
29+
- Add the following path to the list:
30+
```
31+
C:\Program Files\PowerShell\7\
32+
```
33+
> **Note:** If you installed PowerShell 7 in a custom location, replace the above path with the correct one.
34+
### 5. Save Changes
35+
- After adding the path, click **OK** to close the **Edit Environment Variable** window.
36+
- Click **OK** again to close the **Environment Variables** window.
37+
- Finally, click **OK** to exit the **System Properties** window.
38+
### 6. Verify PowerShell 7 in PATH
39+
- Open **Command Prompt** or **Run** (press `Win + R`).
40+
- Type `pwsh` and press Enter.
41+
- If PowerShell 7 opens, you've successfully added it to your PATH!
42+
---
43+
## Troubleshooting
44+
- **PowerShell 7 not opening:** Ensure the path to PowerShell 7 is entered correctly. If you're using a custom installation folder, check that the correct path is added to the `Path` variable.
45+
- **Changes not taking effect:** Try restarting your computer or logging out and logging back in for the changes to apply.

docs/images/DeleteRG.png

76.6 KB
Loading

docs/images/deleteservices.png

116 KB
Loading

docs/images/resource-groups.png

51.5 KB
Loading

docs/images/resourcegroup.png

30.4 KB
Loading

0 commit comments

Comments
 (0)