page:recipes:asset library:asp net core:relational workflow
Host asset library with ASP.NET Core: relational workflow state
Deploy an asset library built with ASP.NET Core on Ample using the transactional workflows pattern. Compute runs the app in an isolated microVM behind a public HTTPS URL, a managed PostgreSQL 16 database is auto-provisioned and injected as DATABASE_URL. Verified on ASP.NET Core: an optimistic version check and an event row written in the same transaction, a stale update rejected, and a history query over the application-owned events (history=2 conflict=rejected). Not separately tested: your domain records, validation rules and concurrency policy; treat the asset library-specific behavior as your application code.
Representative Queries
- Host asset library with ASP.NET Core: relational workflow state
- Where can I host an Asset library built with ASP.NET Core?
- I need a domain record schema, validation rules and concurrency behavior.
Resource Requirements
primitive:computeprimitive:postgres
Infrastructure Requirements
Compute
Status: verified
Summary: Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes.
Canonical Path: /discover/primitive/compute
Postgres
Status: verified
Summary: Managed PostgreSQL 16 runs in its own microVM and is auto-provisioned when an app needs a database and no DATABASE_URL is supplied.
Canonical Path: /discover/primitive/postgres
Prerequisites
- A ASP.NET Core project that builds and starts with the documented commands (dotnet publish -c Release -o out in the builder, then dotnet .dll on the dotnet-10 template with ASPNETCORE_URLS bound to PORT)
- A PostgreSQL driver reading DATABASE_URL at runtime (auto-provisioned when omitted, or supplied with --env)
- An Ample account token with servers:write, databases:read
Workflow Steps
Build and start
- Command:
dotnet publish -c Release -o out in the builder, then dotnet .dll on the dotnet-10 template with ASPNETCORE_URLS bound to PORT. The server must bind 0.0.0.0 on PORT.
- Command:
Implement the pattern on PostgreSQL
- Body: The fixture's module implements transactional workflows: an optimistic version check and an event row written in the same transaction, a stale update rejected, and a history query over the application-owned events (history=2 conflict=rejected). Copy the approach into your schema; keep migrations idempotent and run them with --release-command.
Deploy
- Command:
ample deploy . --name --public
- Command:
Verify
- Command:
ample logs --kind build
- Command:
Success Checks
- HTTP Get on Public URL: app responds on its public URL, expecting
ample canary asp net core patterns - Transactional-workflows self-test: HTTP Get on
/p/transactional-workflowsexpectingtx=ok history=2 conflict=rejected
Limitations
- Verified on the dotnet-10 template at s-1vcpu-1gb with the example fixture; other sizes and templates are not verified.
- The asset library itself (your domain records, validation rules and concurrency policy) is application code and was not separately tested; the pattern checks are what was verified.
Cost Estimate
- Currency: USD
- Monthly Amount: $10.00
- Components:
- App Server (s-1vcpu-1gb): $5.00
- Managed PostgreSQL Database (s-1vcpu-1gb): $5.00
- Components:
- Note: Always-on monthly price of the tested sizes; apps and databases auto-pause when idle.
Example
- ASP.NET Core pattern fixture
- Description: Multi-pattern ASP.NET Core app whose transactional workflows module was checked live.
- Source Ref: tests/deploy-canaries/asp-net-core-patterns
Evidence Summary
- Canary Run: Deployment on Ample was confirmed with passed checks.
- Same ASP.NET Core app was successfully deployed with migration.
Last Verified At
2026-09-21T01:15:54Z