Skip to content

Commit 148922b

Browse files
Merge pull request #639 from microsoft/dev-v3
fix: merging dev to main
2 parents 420718b + acce3b0 commit 148922b

File tree

19 files changed

+235
-48029
lines changed

19 files changed

+235
-48029
lines changed

docs/DeploymentGuide.md

Lines changed: 63 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ If you are done trying out the application, you can delete all resources by runn
326326
```shell
327327
azd down
328328
```
329+
> **Note:** If you deployed with `enableRedundancy=true` and Log Analytics workspace replication is enabled, you must first disable replication before running `azd down` else resource group delete will fail. Follow the steps in [Handling Log Analytics Workspace Deletion with Replication Enabled](./LogAnalyticsReplicationDisable.md), wait until replication returns `false`, then run `azd down`.
329330
330331
# Local setup
331332
@@ -442,7 +443,8 @@ The files for the dev container are located in `/.devcontainer/` folder.
442443
- Make sure to set APP_ENV to "**dev**" in `.env` file.
443444
- For local development, make sure to include below env variables in the `.env`
444445
- `BACKEND_API_URL=http://localhost:8000`
445-
- `FRONTEND_SITE_NAME=http://127.0.0.1:3000` .
446+
- `FRONTEND_SITE_NAME=http://127.0.0.1:3000`
447+
- `MCP_SERVER_ENDPOINT=http://localhost:9000/mcp`.
446448
447449
7. **(Optional) Set up a virtual environment:**
448450
@@ -474,7 +476,16 @@ The files for the dev container are located in `/.devcontainer/` folder.
474476
npm run build
475477
```
476478
477-
10. **Run the application:**
479+
10. **Install requirements - MCP server:**
480+
481+
- To install the requirement for mcp server -
482+
Open a terminal in the `src/mcp_server` folder and run:
483+
```bash
484+
pip install uv
485+
uv sync
486+
```
487+
488+
11. **Run the application:**
478489
479490
- From the `src/backend` directory activate the virtual environment created through step 8 and Run:
480491
@@ -494,14 +505,20 @@ or Run
494505
npm run dev
495506
```
496507
508+
- From the `src/mcp_server` directory activate the virtual environment created through step 10 and Run:
509+
510+
```bash
511+
python mcp_server.py --transport streamable-http --host 0.0.0.0 --port 9000
512+
```
513+
497514
11. Open a browser and navigate to `http://localhost:3000`
498515
12. To see swagger API documentation, you can navigate to `http://localhost:8000/docs`
499516
500517
## Deploy Your local changes
501518
To Deploy your local changes rename the below files.
502519
1. Rename `azure.yaml` to `azure_custom2.yaml` and `azure_custom.yaml` to `azure.yaml`.
503520
2. Go to `infra` directory
504-
- Remove `main.bicep` to `main_custom2.bicep` and `main_custom.bicep` to `main.bicep`.
521+
- Rename `main.bicep` to `main_custom2.bicep` and `main_custom.bicep` to `main.bicep`.
505522
Continue with the [deploying steps](#deploying-with-azd).
506523
507524
@@ -510,15 +527,26 @@ Continue with the [deploying steps](#deploying-with-azd).
510527
You can debug the API backend running locally with VSCode using the following launch.json entry:
511528
512529
```
513-
{
514-
"name": "Python Debugger: Backend",
515-
"type": "debugpy",
516-
"request": "launch",
517-
"cwd": "${workspaceFolder}/src/backend",
518-
"module": "uvicorn",
519-
"args": ["app:app", "--reload"],
520-
"jinja": true
521-
}
530+
{
531+
"name": "Debug Backend (FastAPI)",
532+
"type": "debugpy",
533+
"request": "launch",
534+
"program": "${workspaceFolder}/src/backend/app_kernel.py",
535+
"cwd": "${workspaceFolder}/src/backend",
536+
"console": "integratedTerminal",
537+
"justMyCode": false,
538+
"python": "${workspaceFolder}/src/backend/.venv/Scripts/python.exe",
539+
"env": {
540+
"PYTHONPATH": "${workspaceFolder}/src/backend",
541+
"UVICORN_LOG_LEVEL": "debug"
542+
},
543+
"args": [],
544+
"serverReadyAction": {
545+
"pattern": "Uvicorn running on (https?://[^\\s]+)",
546+
"uriFormat": "%s",
547+
"action": "openExternally"
548+
}
549+
}
522550
```
523551
524552
To debug the python server in the frontend directory (frontend_server.py) and related, add the following launch.json entry:
@@ -534,3 +562,26 @@ To debug the python server in the frontend directory (frontend_server.py) and re
534562
"jinja": true
535563
}
536564
```
565+
566+
To debug the MCP server by adding the following launch.json entry:
567+
568+
```
569+
{
570+
"name": "Debug MCP Server",
571+
"type": "debugpy",
572+
"request": "launch",
573+
"program": "${workspaceFolder}/src/mcp_server/mcp_server.py",
574+
"cwd": "${workspaceFolder}/src/mcp_server",
575+
"console": "integratedTerminal",
576+
"justMyCode": false,
577+
"python": "${workspaceFolder}/src/mcp_server/.venv/Scripts/python.exe",
578+
"env": {
579+
"PYTHONPATH": "${workspaceFolder}/src/mcp_server"
580+
},
581+
"args": [
582+
"--transport", "streamable-http",
583+
"--host", "0.0.0.0",
584+
"--port", "9000"
585+
]
586+
}
587+
```
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# 🛠 Handling Log Analytics Workspace Deletion with Replication Enabled
2+
3+
If redundancy (replication) is enabled for your Log Analytics workspace, you must disable it before deleting the workspace or resource group. Otherwise, deletion will fail.
4+
5+
## ✅ Steps to Disable Replication Before Deletion
6+
Run the following Azure CLI command. Note: This operation may take about 5 minutes to complete.
7+
8+
```bash
9+
az resource update --ids "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{logAnalyticsName}" --set properties.replication.enabled=false
10+
```
11+
12+
Replace:
13+
- `{subscriptionId}` → Your Azure subscription ID
14+
- `{resourceGroupName}` → The name of your resource group
15+
- `{logAnalyticsName}` → The name of your Log Analytics workspace
16+
17+
Optional: Verify replication disabled (should output `false`):
18+
```bash
19+
az resource show --ids "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{logAnalyticsName}" --query properties.replication.enabled -o tsv
20+
```
21+
22+
## ✅ After Disabling Replication
23+
You can safely delete:
24+
- The Log Analytics workspace (manual)
25+
- The resource group (manual), or
26+
- All provisioned resources via `azd down`
27+
28+
Return to: [Deployment Guide](./DeploymentGuide.md)

0 commit comments

Comments
 (0)