Prerequisites
- .NET 10 SDK (see
global.json) - Node.js 20 or later with npm (the repository root is an npm workspace)
- Azure CLI, signed in to the publisher tenant (local debugging uses the Azure dev resources); Bicep for deployment
- Azure Functions Core Tools and Azurite, for the Worker
- An Entra ID test tenant with an app registration for the API
1. Build the solution
src/Valedo.Api/openapi/Valedo.Api.json.
2. Configure the hosts against Azure dev
Local debugging uses the Azure dev resources (Cosmos DBuw-cosmos-valedo-weu-dev, database signatures), not emulators. The hosts sign in to Cosmos DB with your own Entra identity through DefaultAzureCredential; the account has key authentication disabled, so there is no connection string.
-
Sign in to the publisher tenant with the Azure CLI:
-
Get Cosmos DB data access on dev (Cosmos DB Built-in Data Contributor). Without this role, every Cosmos DB request from your machine fails with 403. Get your object ID first:
To grant the role right away, without a full redeploy, deploy only the access module. It creates the same role assignment the full deployment does:To keep the access across deployments, add the same object ID in both places the dev deployment reads it from (Deployment):
-
developerPrincipalIdsininfra/parameters/main.dev.parameters.json, for deployments from your machine; -
the
DEVELOPER_PRINCIPAL_IDSvariable of the GitHubdevenvironment (comma-separated), for deployments from the workflow:--bodyreplaces the whole value, so include the IDs that are already there (gh variable get DEVELOPER_PRINCIPAL_IDS --env dev).
-
-
Copy the Development settings. They already point at dev; real settings files are gitignored.
-
Set the dev app registrations (
AzureAd:*) in user secrets: see Entra app registrations. Put any client secret or certificate in user secrets, never in a file.
AzureWebJobsStorage (UseDevelopmentStorage=true); start it with azurite before func host start. In VS Code, start azurite and then the Valedo: back ends launch configuration.
Production
Local debugging never targets prod. Prod Cosmos DB (uw-cosmos-valedo-weu) holds customer data, and only the managed identities of the two prod App Service apps have data access to it:
- Don’t point local settings or user secrets at the prod account, and don’t run
cosmos-access.bicepagainst it: either would bypass the rule that no developer identity reads prod customer data (README §15.1). - Investigate prod issues from telemetry in Application Insights
uw-appi-valedo-weuand Log Analyticsuw-log-valedo-weu. Logs contain object IDs only, never tokens or rendered signatures. - To reproduce a prod problem, recreate the data in dev and debug there.
3. Run the hosts
Check that both are up:
4. Call the API
Importpostman/valedo-api.postman_collection.json and the valedo-local environment (see Postman). Set accessToken in the environment to a bearer token for your test tenant, then run the requests.