Skip to content

Commit 44f06bb

Browse files
committed
Rebaseline: Remove DAB, update docs/scripts for Hot Chocolate GraphQL
1 parent 93546cc commit 44f06bb

File tree

13 files changed

+243
-460
lines changed

13 files changed

+243
-460
lines changed

docs/DEPLOYMENT_GUIDE.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,12 @@ Prerequisites:
137137

138138
Steps:
139139

140-
1) Start local data stack (Cosmos Emulator, DAB, Portal) [optional]
141140

142-
- PowerShell (Windows):
143-
- pwsh -File ./scripts/run-local.ps1
144-
- Default ports: Cosmos Emulator 8085, DAB 8082, Portal 8081
141+
1) Start local data stack (Cosmos Emulator, Portal, GraphQL API) [optional]
142+
143+
- PowerShell (Windows):
144+
- pwsh -File ./scripts/run-local.ps1
145+
- Default ports: Cosmos Emulator 8085, Portal 8081, GraphQL API 8082
145146

146147
2) Ensure local.settings.json
147148

docs/DEVELOPER_QUICKSTART.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ See also: Known Issues → Functions host exits on startup or endpoints not reac
116116
117117
## 🎯 Minimal Happy Path (Live Data)
118118
119-
This section shows the recommended end-to-end steps to deploy a minimal cloud lab, seed representative data using the seeder, and verify the Management Portal shows live data through the DAB GraphQL endpoint. We place this after local setup and verification because it assumes your development environment and credentials are configured.
119+
120+
This section shows the recommended end-to-end steps to deploy a minimal cloud lab, seed representative data using the seeder, and verify the Management Portal shows live data through the integrated Hot Chocolate GraphQL API. We place this after local setup and verification because it assumes your development environment and credentials are configured.
120121
121122
Prerequisites (cloud): Azure CLI, PowerShell 7+, Bicep CLI, and an Azure subscription with Contributor access for the target resource group.
122123
@@ -135,18 +136,18 @@ az group create -n rg-stamps-smoke -l eastus
135136
az deployment group create -g rg-stamps-smoke -f traffic-routing.bicep --parameters @AzureArchitecture/examples/main.sample.smoke.json
136137
```
137138

138-
1. Wait for deployment to finish; note the Management Portal URL and the DAB Container App outputs from the deployment.
139+
1. Wait for deployment to finish; note the Management Portal URL and the GraphQL API endpoint outputs from the deployment.
139140

140141
1. Seed baseline data: run the seeder in `AzureArchitecture/Seeder`. The seeder uses `DefaultAzureCredential` so your signing principal must have the Cosmos DB Data Contributor role on the target account. See `AzureArchitecture/README.md` or `docs/LIVE_DATA_PATH.md` for seeder options.
141142

142-
1. Verify DAB GraphQL is healthy: POST a simple GraphQL query to the DAB endpoint; see `docs/LIVE_DATA_PATH.md` for the exact query and examples.
143+
1. Verify the Hot Chocolate GraphQL API is healthy: POST a simple GraphQL query to the endpoint (e.g., <http://localhost:8082/graphql> or the deployed URL). You can use Banana Cake Pop, Insomnia, Postman, or curl. See `docs/LIVE_DATA_PATH.md` for the exact query and examples.
143144

144145
1. Open the Management Portal URL and sign in; confirm Tenants and Cells are visible and resolve through the portal UI.
145146

146147
1. If you see no data, check the following:
147148

148-
- Container App logs for the DAB (`ca-stamps-dab`) and Portal (`ca-stamps-portal`).
149-
- Confirm DAB GraphQL responds directly with a simple query.
149+
- Container App logs for the Portal (`ca-stamps-portal`).
150+
- Confirm the GraphQL API responds directly with a simple query.
150151
- Ensure the seeder principal has the correct RBAC role on Cosmos (Cosmos DB Data Contributor).
151152

152153
1. For auth or CI/OIDC troubleshooting, see `docs/AUTH_CI_STRATEGY.md`.

management-portal/README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Management Portal
22

3-
Run locally with one command or via the AppHost. Defaults to in-memory data; set DAB_GRAPHQL_URL to point to your Data API Builder GraphQL endpoint to use real data.
3+
4+
Run locally with one command or via the AppHost. By default, the portal uses in-memory data. For live data, it connects to the built-in Hot Chocolate GraphQL endpoint, which provides full CRUD for Cosmos DB entities.
45

56
## Auth and roles (production)
67

7-
- **Hosting**: Azure Container Apps (ACA) for the portal and DAB API; Azure Functions for command handlers
8-
- **Authentication**: Azure Entra ID with OpenID Connect for administrative access
9-
- **Authorization**: DAB auth provider uses AppService-compatible headers from Container Apps authentication
8+
**Hosting**: Azure Container Apps (ACA) for the portal and Hot Chocolate GraphQL API; Azure Functions for command handlers
9+
**Authentication**: Azure Entra ID with OpenID Connect for administrative access
10+
**Authorization**: Uses AppService-compatible headers from Container Apps authentication
1011
- **Portal Roles**:
1112
- `authenticated` (read access to tenant data)
1213
- `platform.admin` (full CRUD access)
@@ -49,22 +50,33 @@ Troubleshooting
4950

5051
## Config
5152

52-
- DAB_GRAPHQL_URL: e.g. <http://localhost:8082/graphql>
53+
54+
## GraphQL Endpoint
55+
56+
- Hot Chocolate GraphQL endpoint: <http://localhost:8082/graphql>
5357

5458
## Switch Data Source
5559

56-
- Leave DAB_GRAPHQL_URL empty to use in-memory data
57-
- Set DAB_GRAPHQL_URL to use GraphQL
60+
61+
By default, the portal uses in-memory data. When running in production or with Cosmos DB, the portal uses the built-in Hot Chocolate GraphQL API for all data operations.
5862

5963
## CRUD
6064

61-
- Tenants, Cells, and Operations pages support create/update/delete when GraphQL is enabled (DAB provides mutations).
62-
- For in-memory mode, operations affect only the running process.
65+
66+
Tenants, Cells, and Operations pages support create/update/delete via the Hot Chocolate GraphQL API. In in-memory mode, operations affect only the running process.
6367

6468
## Smoke test (GraphQL)
6569

66-
After starting the local stack, run a minimal CRUD test against DAB:
6770

68-
- pwsh -File .\scripts\graphql-smoke-test.ps1 -AsAdmin
71+
After starting the local stack, you can run a minimal CRUD test against the Hot Chocolate GraphQL endpoint using your favorite GraphQL client (e.g., Banana Cake Pop, Insomnia, Postman, or curl). Example mutation:
72+
73+
```
74+
mutation {
75+
createTenant(input: { id: "t1", displayName: "Test Tenant", domain: "test.com", tier: "Standard", status: "Active", cellId: "cell1", contactName: "Jane Doe", contactEmail: "jane@example.com" }) {
76+
id
77+
displayName
78+
}
79+
}
80+
```
6981

70-
The script lists tenants, creates a temporary tenant, and deletes it (using partitionKeyValue = tenantId). Use -AsAdmin to simulate the `platform.admin` role via X-MS-CLIENT-PRINCIPAL.
82+
You can also use the built-in Banana Cake Pop GraphQL IDE at <http://localhost:8082/graphql> for interactive queries and mutations.

management-portal/dab/Dockerfile

Lines changed: 0 additions & 19 deletions
This file was deleted.

management-portal/dab/dab-config.json

Lines changed: 0 additions & 44 deletions
This file was deleted.

management-portal/dab/schema.graphql

Lines changed: 0 additions & 87 deletions
This file was deleted.

management-portal/docs/plan.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
# Plan to Resolve DAB GraphQL Query Failures
1+
2+
# Plan to Resolve GraphQL Query Failures
23

34
## Overview
4-
This plan addresses the issue of GraphQL queries failing to retrieve data from Cosmos DB via Data API Builder (DAB) in the management-portal project. It breaks down the diagnosis and resolution into actionable steps.
5+
6+
This plan addresses the issue of GraphQL queries failing to retrieve data from Cosmos DB via the Hot Chocolate GraphQL API in the management-portal project. It breaks down the diagnosis and resolution into actionable steps.
57

68
## Todo List
7-
- [ ] Verify DAB container health and logs for crash loops or startup errors using Azure CLI commands.
8-
- [ ] Compare GraphQL schema (schema.graphql) with Cosmos DB container structures for mismatches.
9-
- [ ] Test sample GraphQL queries directly against DAB endpoint to reproduce retrieval failures.
9+
10+
- [ ] Verify GraphQL API health and logs for crash loops or startup errors using Azure CLI commands.
11+
- [ ] Compare GraphQL schema (as exposed by Hot Chocolate) with Cosmos DB container structures for mismatches.
12+
- [ ] Test sample GraphQL queries directly against the GraphQL endpoint to reproduce retrieval failures.
1013
- [ ] Analyze error handling in GraphQLDataService.cs and add logging for detailed failure insights.
1114
- [ ] Review Bicep deployment (management-portal.bicep) for configuration issues like ports or secrets.
1215
- [ ] Implement fixes, such as updating schema or deployment settings, and redeploy.

management-portal/infra/DAB_FIX_PROGRESS.md

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)