This project accepts Rewst contracts and returns .xlsx files.
| Audience | Start here |
|---|---|
| Operators (deploy, keys, monitoring) | Fork, deploy, and API keys → SETUP.md (security checklist) |
| CI | GitHub Actions: dotnet test + dotnet build on push/PR (.github/workflows/ci.yml) |
Rewst authors (validate → render, payload_json) |
REWST_SUBWORKFLOW.md, REWST_PAYLOAD_GUIDE.md |
| SharePoint / Graph | ENTRA_GRAPH_SETUP.md, SETUP.md (app settings) |
Error codes and path |
ERROR_CODES.md |
Versioning: Feature bullets below (e.g. v1.1) describe contract and API behavior. The info.version field inside /api/openapi-rewst.json is the Rewst OpenAPI document revision only; it may move independently of schema_version in your JSON contracts.
This is not a hosted product. If you use it, you are expected to fork the repository, deploy your own Azure Functions instance (or run it locally), and operate it yourself.
- Your API key — Create a secret (e.g.
RENDER_API_KEYin app settings) and configure Rewst’s HTTP integration to sendX-Api-Keywith that value. You generate and rotate keys; nothing is issued to you by this repo. Prefer storing it in Azure Key Vault and referencing it from app settings (see SETUP.md). - Your environment — You own configuration, networking, cost, and security hardening. Secrets: Key Vault references for
RENDER_API_KEYandGRAPH_CLIENT_SECRETwhere possible. Monitoring: Application Insights alerts for 5xx and unusual traffic (recommended in SETUP.md). Runbook: Record base URL, Rewst integration details, and rotation ownership outside of git secrets. Strongly recommended: restrict inbound traffic to Rewst’s outbound NAT IPs for your region (SETUP.md — Step 12; Rewst security policy). On Consumption plans you may need Premium / Dedicated (or another edge) to enforce IP rules on the Function App. - Buyer beware — Provided as-is, without warranty. No guaranteed support, SLA, or obligation to help with your fork, workflows, or deployments. Use at your own risk.
Azure setup (Portal-first, optional Bicep): SETUP.md — create the Function App in the Azure Portal step by step, or deploy infra/main.bicep, then follow the same security and Rewst steps.
- Tier 1:
workbook+worksheets+blocks(direct renderer model) - Tier 2:
sources+sheets(simple and joined reports)
strict_modeon tier 2 contractsPOST /api/validatecontract validator endpoint- coded warnings/errors (e.g.
SRC_NOT_FOUND,JOIN_KEY_MISSING) - render stats in JSON response (
sheet_count,block_count,row_count) - guardrails via app settings:
MAX_REQUEST_BYTES,MAX_ROWS_PER_SHEET - defaults support:
date_format,datetime_format,boolean_display
delivery.format:binaryorbase64(alias ofbase64_jsonresponse mode)row_rules: row-level styling (danger,warning,success)- source resilience:
on_empty/on_null(supportsomit_columns+use_defaultbehavior) defaults.null_display: replacement value for null values in tier 2 transforms
binary(default): HTTP body is Excel bytes, withContent-Dispositiondownload header.base64_json: HTTP body is JSON withcontent_base64,warnings, andstats.
These endpoints take the inner contract JSON as the request body (not the Rewst payload_json wrapper). Validation and rendering rules match the Rewst tier routes; generic routes do not enforce tier via the URL, so keep your inner JSON shape consistent with how you call /api/rewst/tier1/* vs /api/rewst/tier2/*.
POST /api/renderPOST /api/validateGET /api/healthGET /api/openapi.json
Import GET /api/openapi-rewst.json into Rewst. Each generated action has one body field: payload_json (a string). Use tier-specific routes so the correct contract is enforced:
| Tier | Validate | Render | Inner JSON root |
|---|---|---|---|
| 1 | POST /api/rewst/tier1/validate |
POST /api/rewst/tier1/render |
workbook |
| 2 | POST /api/rewst/tier2/validate |
POST /api/rewst/tier2/render |
sheets (array) |
SharePoint (optional): POST /api/rewst/sharepoint/upload — upload content_base64 via Microsoft Graph (GRAPH_* app settings). Entra app + permissions: ENTRA_GRAPH_SETUP.md; deploy + settings: SETUP.md.
Set X-Api-Key on the HTTP integration (not per action) to the same value you configured as RENDER_API_KEY on your Function App. Optional X-Correlation-Id is listed in the Rewst OpenAPI for tracing; you can instead configure headers on the integration.
Docs: REWST_SUBWORKFLOW.md (validate → render subworkflow), REWST_PAYLOAD_GUIDE.md (examples), ERROR_CODES.md (codes and path). Support: see Fork, deploy, and API keys (operators) above.
Use this body with POST /api/validate when not using the Rewst wrapper:
POST /api/validate
Content-Type: application/json
X-Api-Key: <your key>{
"schema_version": "1.0",
"strict_mode": false,
"delivery": { "format": "base64" },
"defaults": {
"null_display": "—",
"date_format": "yyyy-mm-dd",
"datetime_format": "yyyy-mm-dd hh:mm",
"boolean_display": ["Yes", "No"],
"freeze_header": true
},
"sources": {
"users": {
"data": [
{ "id": "u1", "displayName": "Alice", "enabled": true, "createdDate": "2026-04-01" }
],
"key": "id"
}
},
"sheets": [
{
"name": "Users",
"primary_source": "users",
"columns": {
"displayName": { "header": "Name", "type": "string" },
"enabled": { "header": "Enabled", "type": "boolean" },
"createdDate": { "header": "Created", "type": "date" }
}
}
]
}Example success response:
{
"valid": true,
"response_mode": "base64_json",
"errors": [],
"warnings": []
}FUNCTIONS_WORKER_RUNTIME=dotnet-isolated(runtime mode). Flex Consumption: platform may manage this setting; if manual value conflicts, follow the guidance in SETUP.md.RENDER_API_KEY— required (non-empty). Clients must sendX-Api-KeyorAuthorization: Bearerwith the same value. If the app setting is missing or empty, protected routes return 503 (misconfiguration). For local runs, set it inlocal.settings.json(seeExcelRenderer.Functions/local.settings.json.example) or user secrets; never commit real keys. Prefer Key Vault references in Azure: SETUP.md.DEFAULT_TABLE_THEME(optional, defaultTableStyleMedium2)MAX_REQUEST_BYTES(default 5000000)MAX_ROWS_PER_SHEET(default 20000)
Hardening summary: SETUP.md — Security and operations checklist.
- Copy
ExcelRenderer.Functions/local.settings.json.exampletolocal.settings.jsonand setRENDER_API_KEY(see SETUP.md Step 1). - From
ExcelRenderer.Functions:
func start- Optional: with the host up,
SMOKE_API_KEY=<same as RENDER_API_KEY>then runscripts/smoke-test.shorscripts/smoke-test.ps1.
Full walkthrough (Azure Portal as the default path, Bicep optional, Key Vault, publish, smoke tests, Rewst): SETUP.md.