Skip to content

Commit 03657a8

Browse files
Merge remote-tracking branch 'origin/dev' into dependabot-update
2 parents efde6c3 + 8024e5f commit 03657a8

11 files changed

Lines changed: 159 additions & 29 deletions

File tree

documents/LocalDevelopmentSetup.md

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,46 @@ Create `.vscode/settings.json` and copy the following JSON:
293293

294294
---
295295

296+
### Running with Automated Script
297+
298+
For convenience, you can use the provided startup scripts that handle environment setup and start both backend and frontend services automatically. This is the quickest way to get up and running locally.
299+
300+
> **Note**: You must complete **Step 1 (Prerequisites)** and **Step 2 (Development Tools Setup)** before using the automated scripts.
301+
302+
#### Windows (Command Prompt or PowerShell):
303+
304+
```cmd
305+
cd src
306+
.\start.cmd
307+
```
308+
309+
#### macOS/Linux/WSL:
310+
311+
```bash
312+
cd src
313+
chmod +x start.sh
314+
./start.sh
315+
```
316+
317+
### What the Scripts Do
318+
319+
The startup scripts automatically handle:
320+
- Environment variable configuration
321+
- Azure authentication
322+
- Azure RBAC role assignments (Cosmos DB, SQL Server, AI Foundry, AI Search)
323+
- Python virtual environment setup
324+
- Backend dependency installation
325+
- Frontend dependency installation
326+
- Starting both backend and frontend servers
327+
328+
> **Note**: The script includes a 30-second wait for the backend to initialize before starting the frontend. If you see connection errors initially, wait a moment and reload the page.
329+
330+
---
331+
332+
## Running Backend and Frontend Manually
333+
334+
If you prefer more control over the setup process, follow the steps below to configure and run each service individually.
335+
296336
## Step 3: Azure Authentication Setup
297337

298338
Before configuring services, authenticate with Azure:
@@ -385,13 +425,17 @@ az role assignment create \
385425
```
386426

387427
#### Cosmos DB Access
388-
389428
```bash
429+
# Get your principal ID
430+
PRINCIPAL_ID=$(az ad signed-in-user show --query id -o tsv)
431+
390432
# Assign Cosmos DB Built-in Data Contributor role
391-
az role assignment create \
392-
--role "Cosmos DB Built-in Data Contributor" \
393-
--assignee $PRINCIPAL_ID \
394-
--scope "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.DocumentDB/databaseAccounts/<cosmos-account-name>"
433+
az cosmosdb sql role assignment create \
434+
--resource-group <resource-group-name> \
435+
--account-name <cosmos-db-account-name> \
436+
--role-definition-name "Cosmos DB Built-in Data Contributor" \
437+
--principal-id $PRINCIPAL_ID \
438+
--scope /subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.DocumentDB/databaseAccounts/<cosmos-db-account-name>
395439
```
396440

397441
#### Azure Storage Access

infra/main.bicep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ module searchServiceUpdate 'br/public:avm/res/search/search-service:0.12.0' = {
780780
params: {
781781
// Required parameters
782782
name: aiSearchName
783+
location: location
783784
enableTelemetry: enableTelemetry
784785
diagnosticSettings: enableMonitoring ? [
785786
{

infra/main.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "0.41.2.15936",
9-
"templateHash": "9287430903779325833"
9+
"templateHash": "18133262101573574086"
1010
}
1111
},
1212
"parameters": {
@@ -408,7 +408,7 @@
408408
"sqlServerResourceName": "[format('sql-{0}', variables('solutionSuffix'))]",
409409
"sqlDbModuleName": "[format('sqldb-{0}', variables('solutionSuffix'))]",
410410
"webServerFarmResourceName": "[format('asp-{0}', variables('solutionSuffix'))]",
411-
"reactAppLayoutConfig": "{\r\n \"appConfig\": {\r\n \"THREE_COLUMN\": {\r\n \"DASHBOARD\": 50,\r\n \"CHAT\": 33,\r\n \"CHATHISTORY\": 17\r\n },\r\n \"TWO_COLUMN\": {\r\n \"DASHBOARD_CHAT\": {\r\n \"DASHBOARD\": 65,\r\n \"CHAT\": 35\r\n },\r\n \"CHAT_CHATHISTORY\": {\r\n \"CHAT\": 80,\r\n \"CHATHISTORY\": 20\r\n }\r\n }\r\n },\r\n \"charts\": [\r\n {\r\n \"id\": \"SATISFIED\",\r\n \"name\": \"Satisfied\",\r\n \"type\": \"card\",\r\n \"layout\": { \"row\": 1, \"column\": 1, \"height\": 11 }\r\n },\r\n {\r\n \"id\": \"TOTAL_CALLS\",\r\n \"name\": \"Total Calls\",\r\n \"type\": \"card\",\r\n \"layout\": { \"row\": 1, \"column\": 2, \"span\": 1 }\r\n },\r\n {\r\n \"id\": \"AVG_HANDLING_TIME\",\r\n \"name\": \"Average Handling Time\",\r\n \"type\": \"card\",\r\n \"layout\": { \"row\": 1, \"column\": 3, \"span\": 1 }\r\n },\r\n {\r\n \"id\": \"SENTIMENT\",\r\n \"name\": \"Topics Overview\",\r\n \"type\": \"donutchart\",\r\n \"layout\": { \"row\": 2, \"column\": 1, \"width\": 40, \"height\": 44.5 }\r\n },\r\n {\r\n \"id\": \"AVG_HANDLING_TIME_BY_TOPIC\",\r\n \"name\": \"Average Handling Time By Topic\",\r\n \"type\": \"bar\",\r\n \"layout\": { \"row\": 2, \"column\": 2, \"row-span\": 2, \"width\": 60 }\r\n },\r\n {\r\n \"id\": \"TOPICS\",\r\n \"name\": \"Trending Topics\",\r\n \"type\": \"table\",\r\n \"layout\": { \"row\": 3, \"column\": 1, \"span\": 2 }\r\n },\r\n {\r\n \"id\": \"KEY_PHRASES\",\r\n \"name\": \"Key Phrases\",\r\n \"type\": \"wordcloud\",\r\n \"layout\": { \"row\": 3, \"column\": 2, \"height\": 44.5 }\r\n }\r\n ]\r\n}",
411+
"reactAppLayoutConfig": "{\n \"appConfig\": {\n \"THREE_COLUMN\": {\n \"DASHBOARD\": 50,\n \"CHAT\": 33,\n \"CHATHISTORY\": 17\n },\n \"TWO_COLUMN\": {\n \"DASHBOARD_CHAT\": {\n \"DASHBOARD\": 65,\n \"CHAT\": 35\n },\n \"CHAT_CHATHISTORY\": {\n \"CHAT\": 80,\n \"CHATHISTORY\": 20\n }\n }\n },\n \"charts\": [\n {\n \"id\": \"SATISFIED\",\n \"name\": \"Satisfied\",\n \"type\": \"card\",\n \"layout\": { \"row\": 1, \"column\": 1, \"height\": 11 }\n },\n {\n \"id\": \"TOTAL_CALLS\",\n \"name\": \"Total Calls\",\n \"type\": \"card\",\n \"layout\": { \"row\": 1, \"column\": 2, \"span\": 1 }\n },\n {\n \"id\": \"AVG_HANDLING_TIME\",\n \"name\": \"Average Handling Time\",\n \"type\": \"card\",\n \"layout\": { \"row\": 1, \"column\": 3, \"span\": 1 }\n },\n {\n \"id\": \"SENTIMENT\",\n \"name\": \"Topics Overview\",\n \"type\": \"donutchart\",\n \"layout\": { \"row\": 2, \"column\": 1, \"width\": 40, \"height\": 44.5 }\n },\n {\n \"id\": \"AVG_HANDLING_TIME_BY_TOPIC\",\n \"name\": \"Average Handling Time By Topic\",\n \"type\": \"bar\",\n \"layout\": { \"row\": 2, \"column\": 2, \"row-span\": 2, \"width\": 60 }\n },\n {\n \"id\": \"TOPICS\",\n \"name\": \"Trending Topics\",\n \"type\": \"table\",\n \"layout\": { \"row\": 3, \"column\": 1, \"span\": 2 }\n },\n {\n \"id\": \"KEY_PHRASES\",\n \"name\": \"Key Phrases\",\n \"type\": \"wordcloud\",\n \"layout\": { \"row\": 3, \"column\": 2, \"height\": 44.5 }\n }\n ]\n}",
412412
"backendWebSiteResourceName": "[format('api-{0}', variables('solutionSuffix'))]",
413413
"webSiteResourceName": "[format('app-{0}', variables('solutionSuffix'))]"
414414
},
@@ -31613,6 +31613,9 @@
3161331613
"name": {
3161431614
"value": "[variables('aiSearchName')]"
3161531615
},
31616+
"location": {
31617+
"value": "[parameters('location')]"
31618+
},
3161631619
"enableTelemetry": {
3161731620
"value": "[parameters('enableTelemetry')]"
3161831621
},
@@ -41904,10 +41907,10 @@
4190441907
}
4190541908
},
4190641909
"dependsOn": [
41910+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageBlob)]",
4190741911
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageDfs)]",
41908-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageFile)]",
4190941912
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageQueue)]",
41910-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageBlob)]",
41913+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageFile)]",
4191141914
"userAssignedIdentity",
4191241915
"virtualNetwork"
4191341916
]

infra/main_custom.bicep

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,7 @@ module searchServiceUpdate 'br/public:avm/res/search/search-service:0.12.0' = {
781781
params: {
782782
// Required parameters
783783
name: aiSearchName
784+
location: location
784785
enableTelemetry: enableTelemetry
785786
diagnosticSettings: enableMonitoring ? [
786787
{
@@ -856,6 +857,9 @@ module searchServiceUpdate 'br/public:avm/res/search/search-service:0.12.0' = {
856857
]
857858
: []
858859
}
860+
dependsOn: [
861+
searchService
862+
]
859863
}
860864

861865
// ========== Search Service to AI Services Role Assignment ========== //
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
aiohttp==3.13.3
1+
aiohttp==3.13.4
22
azure-identity==1.25.2
33
azure-ai-projects==2.0.0b3

infra/scripts/run_create_agents_scripts.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@ titleAgentName=""
330330
while IFS='=' read -r key value; do
331331
# Skip empty lines or lines without '='
332332
[ -z "$key" ] && continue
333+
# Strip trailing carriage return if present (Windows line endings)
334+
value="${value%$'\r'}"
333335
case "$key" in
334336
conversationAgentName)
335337
conversationAgentName="$value"

src/App/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"d3-color": "$d3-color",
7171
"nth-check": "$nth-check",
7272
"flatted": "^3.4.2",
73+
"lodash": "4.18.1",
7374
"node-forge": "^1.4.0",
7475
"react-scripts": {
7576
"picomatch": "^4.0.4"

src/api/requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ pydantic[email]==2.11.10
77

88
# Azure SDK Core
99
azure-core==1.38.0
10-
requests==2.32.5
11-
types-requests==2.32.4.20260107
12-
aiohttp==3.13.3
10+
requests==2.33.0
11+
types-requests==2.33.0.20260408
12+
aiohttp==3.13.4
1313

1414
# Azure Services
1515
azure-identity==1.25.2
@@ -35,6 +35,6 @@ opentelemetry-instrumentation==0.60b0
3535
azure-monitor-opentelemetry==1.8.3
3636

3737
# Development tools
38-
pytest==9.0.2
38+
pytest==9.0.3
3939
pytest-cov==7.0.0
4040
pytest-asyncio==1.3.0

src/start.cmd

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ if exist "%API_ENV_FILE%" (
107107
echo 2. Manually create %API_ENV_FILE% with required environment variables
108108
echo 3. Copy an existing .env file to %API_ENV_FILE%
109109
echo.
110-
echo For more information, see: documents/LocalDebuggingSetup.md
110+
echo For more information, see: documents/LocalDevelopmentSetup.md
111111
exit /b 1
112112
)
113113

@@ -131,7 +131,7 @@ set APP_ENV_FILE=%ROOT_DIR%\src\App\.env
131131
(
132132
echo REACT_APP_API_BASE_URL=http://127.0.0.1:8000
133133
) > "%APP_ENV_FILE%"
134-
echo Updated src/App/.env with APP_API_BASE_URL
134+
echo Updated src/App/.env with REACT_APP_API_BASE_URL
135135

136136
REM Add or update APP_ENV="dev" in API .env file
137137
echo Checking for existing APP_ENV in src/api/.env...
@@ -284,6 +284,18 @@ if errorlevel 1 (
284284
)
285285
cd %ROOT_DIR%
286286

287+
REM Close any processes using ports 8000 and 3000
288+
echo Checking for processes using ports 8000 and 3000...
289+
REM Kill any existing processes on ports 8000 and 3000 before starting
290+
for %%P in (8000 3000) do (
291+
for /f "tokens=5" %%A in ('netstat -ano ^| findstr "LISTENING" ^| findstr ":%%P "') do (
292+
if "%%A" neq "0" (
293+
echo Port %%P is already in use by PID %%A. Stopping it...
294+
taskkill /F /PID %%A /T >nul 2>&1
295+
)
296+
)
297+
)
298+
287299
REM Start backend and frontend
288300
echo Starting backend server...
289301
cd %ROOT_DIR%
@@ -297,10 +309,27 @@ timeout /t 30 /nobreak >nul
297309

298310
echo Starting frontend server...
299311
cd %ROOT_DIR%\src\App
300-
call npm start
301312

302-
echo Both servers have been started.
303-
echo Backend running at http://127.0.0.1:8000
304-
echo Frontend running at http://localhost:3000
313+
REM Show server information before starting
314+
echo.
315+
echo ========================================
316+
echo Both servers are now running:
317+
echo Backend: http://127.0.0.1:8000
318+
echo Frontend: http://localhost:3000
319+
echo ========================================
320+
echo Press Ctrl+C to stop all servers
321+
echo.
322+
323+
REM Start npm with PowerShell wrapper for automatic cleanup on Ctrl+C (single line for reliability)
324+
powershell -NoProfile -ExecutionPolicy Bypass -Command "try { npm start } finally { Write-Host ''; Write-Host 'Stopping all processes...'; Start-Sleep -Milliseconds 500; @(8000, 3000) | ForEach-Object { $port = $_; Get-NetTCPConnection -LocalPort $port -State Listen -ErrorAction SilentlyContinue | ForEach-Object { $pid_ = $_.OwningProcess; if ($pid_ -and $pid_ -ne 0) { taskkill /F /PID $pid_ /T 2>$null } } }; Write-Host 'Cleanup complete.'; Write-Host ''; Write-Host 'All servers stopped.' -ForegroundColor Yellow }"
325+
326+
REM Fallback cleanup in case PowerShell finally block was interrupted
327+
for %%P in (8000 3000) do (
328+
for /f "tokens=5" %%A in ('netstat -ano ^| findstr "LISTENING" ^| findstr ":%%P "') do (
329+
if "%%A" neq "0" (
330+
taskkill /F /PID %%A /T >nul 2>&1
331+
)
332+
)
333+
)
305334

306335
endlocal

0 commit comments

Comments
 (0)