|
1 | 1 | # Management Portal |
2 | 2 |
|
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. |
4 | 5 |
|
5 | 6 | ## Auth and roles (production) |
6 | 7 |
|
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 |
10 | 11 | - **Portal Roles**: |
11 | 12 | - `authenticated` (read access to tenant data) |
12 | 13 | - `platform.admin` (full CRUD access) |
@@ -49,22 +50,33 @@ Troubleshooting |
49 | 50 |
|
50 | 51 | ## Config |
51 | 52 |
|
52 | | -- DAB_GRAPHQL_URL: e.g. <http://localhost:8082/graphql> |
| 53 | + |
| 54 | +## GraphQL Endpoint |
| 55 | + |
| 56 | +- Hot Chocolate GraphQL endpoint: <http://localhost:8082/graphql> |
53 | 57 |
|
54 | 58 | ## Switch Data Source |
55 | 59 |
|
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. |
58 | 62 |
|
59 | 63 | ## CRUD |
60 | 64 |
|
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. |
63 | 67 |
|
64 | 68 | ## Smoke test (GraphQL) |
65 | 69 |
|
66 | | -After starting the local stack, run a minimal CRUD test against DAB: |
67 | 70 |
|
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 | +``` |
69 | 81 |
|
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. |
0 commit comments