Skip to content

Commit 912dd52

Browse files
Merge pull request #443 from microsoft/main
fix: downmerge main to dev
2 parents f7786af + 19fe7d9 commit 912dd52

File tree

2 files changed

+106
-2
lines changed

2 files changed

+106
-2
lines changed

Deployment/resourcedeployment.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ function DeployAzureResources([string]$location, [string]$modelLocation) {
246246

247247
# Perform a what-if deployment to preview changes
248248
Write-Host "Evaluating Deployment resource availabilities to preview changes..." -ForegroundColor Yellow
249-
$whatIfResult = az deployment group what-if --resource-group $resourceGroupName --template-file .\main.bicep --name $deploymentName --parameters modeldatacenter=$modelLocation location=$location environmentName=$environmentName
249+
$whatIfResult = az deployment group what-if --resource-group $resourceGroupName --template-file "./main.bicep" --name $deploymentName --parameters modeldatacenter=$modelLocation location=$location environmentName=$environmentName
250250

251251
if ($LASTEXITCODE -ne 0) {
252252
Write-Host "There might be something wrong with your deployment." -ForegroundColor Red
@@ -257,7 +257,7 @@ function DeployAzureResources([string]$location, [string]$modelLocation) {
257257
# Proceed with the actual deployment
258258
Write-Host "Proceeding with Deployment..." -ForegroundColor Yellow
259259
Write-Host "Resource Group Name: $resourceGroupName" -ForegroundColor Yellow
260-
$deploymentResult = az deployment group create --resource-group $resourceGroupName --template-file .\main.bicep --name $deploymentName --parameters modeldatacenter=$modelLocation location=$location environmentName=$environmentName
260+
$deploymentResult = az deployment group create --resource-group $resourceGroupName --template-file "./main.bicep" --name $deploymentName --parameters modeldatacenter=$modelLocation location=$location environmentName=$environmentName
261261
# Check if deploymentResult is valid
262262
ValidateVariableIsNullOrEmpty -variableValue $deploymentResult -variableName "Deployment Result"
263263
if ($LASTEXITCODE -ne 0) {

docs/LocalSetupGuide.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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

Comments
 (0)