Skip to content

Document the Community Toolkit RavenDB Cloud hosting integration - #2287

Open
Gracjan Sadowicz (poissoncorp) wants to merge 2 commits into
microsoft:mainfrom
poissoncorp:ravendb-cloud
Open

Gracjan Sadowicz (poissoncorp) wants to merge 2 commits into
microsoft:mainfrom
poissoncorp:ravendb-cloud

Conversation

@poissoncorp

Copy link
Copy Markdown

Summary

Adds documentation for the Community Toolkit RavenDB Cloud hosting integration, 📦 CommunityToolkit.Aspire.Hosting.RavenDB.Cloud. The integration was added to the toolkit in CommunityToolkit/Aspire#2413 and ships as a preview package. With it, aspire run keeps the local RavenDB container, while aspire deploy creates or finds a RavenDB Cloud product and gives every app its node URLs and a client certificate of its own.

  • integrations/databases/ravendb/ravendb-cloud.mdx (new): prerequisites, installation, publishing the server with PublishAsRavenDBCloud, the spec, the deployment plan and approving changes, attaching to an existing product, network access, what apps receive, pipeline steps, destroy, continuous deployment, and known limitations, with TypeScript and C# examples.
  • ravendb-get-started.mdx: a third step that links to the new page.
  • ravendb-host.mdx: a "Deploy to RavenDB Cloud" section.
  • ravendb-connect.mdx: node URLs of a cluster in URL, and the client certificate as CertificateBase64.
  • Sidebar entry in the RavenDB group.

The package's catalog entry comes from the integration data updater once its first build is on NuGet. I'll add the CommunityToolkit.Aspire.Hosting.RavenDB.Cloud mapping to integration-docs.json then, since the update-integrations tests require every mapping to have a catalog entry.

Third-party links and affiliations

Links added:

Affiliation: I work at RavenDB and maintain the RavenDB integrations in the Community Toolkit.

Validation

  • Rendered the new page and the three changed pages with astro dev. They return 200 and show the tabs, asides and the sidebar entry.
  • Ran Prettier on the new page and the sidebar file.
  • Ran update-integrations.vitest.test.ts and dev-resource-catalog.vitest.test.ts: 75 passed.
  • Checked the RavenDB pages against .github/forbidden-words.json.
  • The examples follow the toolkit's C# and TypeScript examples for the package, which its tests build and run, the TypeScript AppHost through the Aspire CLI.

@poissoncorp

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="RavenDB Ltd"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documentation provides unusable preview-package installation commands, omits the client version required for certificate support, and deploys applications to an ephemeral runner while leaving billable RavenDB Cloud resources behind.

4 open issues
What changed in this PR

Adds RavenDB Cloud deployment guidance to the existing RavenDB integration documentation.

Changes:

  • Documents cloud provisioning, deployment, cleanup, and CI with TypeScript and C# examples.
  • Adds cluster URL and client-certificate configuration guidance.
  • Links the new guide from existing pages and the sidebar.
File Description
src/​frontend/​src/​content/​docs/​integrations/​databases/​ravendb/​ravendb-host.mdx Links hosting guidance to cloud deployment.
src/​frontend/​src/​content/​docs/​integrations/​databases/​ravendb/​ravendb-get-started.mdx Adds a cloud deployment step.
src/​frontend/​src/​content/​docs/​integrations/​databases/​ravendb/​ravendb-connect.mdx Documents cluster URLs and certificate configuration.
src/​frontend/​src/​content/​docs/​integrations/​databases/​ravendb/​ravendb-cloud.mdx Adds the RavenDB Cloud deployment guide.
src/​frontend/​config/​sidebar/​integrations.topics.ts Adds the guide to RavenDB navigation.

Review effort: Balanced

<TabItem id="typescript" label="TypeScript">

```bash title="Terminal"
aspire add CommunityToolkit.Aspire.Hosting.RavenDB.Cloud

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: both aspire add commands take --version <prerelease-version>, with a note on where to find the version and on staging and dev CLIs, as on the API Management page.

Or add the package manually:

```xml title="AppHost.csproj"
<PackageReference Include="CommunityToolkit.Aspire.Hosting.RavenDB.Cloud" Version="*" />

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: the PackageReference names a prerelease version too. I left out *-*, because the toolkit publishes a beta of every package from each merge, and *-* would pick those up.

```yaml title=".github/workflows/deploy.yml"
jobs:
deploy:
runs-on: ubuntu-latest

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, fixed: the example runs on a self-hosted runner, and the text explains that Compose starts the apps on the runner's Docker, so a GitHub-hosted runner takes them down when the job ends while the product keeps running.

}
```

**Client certificate.** A secured server needs a client certificate. Configuration can give it as a file (`CertificatePath`, with `CertificatePassword` if the file has one) or as the base64-encoded content of a .pfx file (`CertificateBase64`), which suits a certificate delivered as a value, such as an environment variable:

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client with CertificateBase64 ships in the same release as the RavenDB Cloud package. An app that already references an older client keeps it when the Cloud package is added to the AppHost, though, so both pages now say in one line to update the client in the apps too.

@IEvangelist David Pine (IEvangelist) added the DOT NOT MERGE This should not be merged. label Dec 4, 2026
@IEvangelist

Copy link
Copy Markdown
Member

Hi Gracjan Sadowicz (@poissoncorp), thanks for the PR. Can we flip this to a draft until the NuGet package is available?

@IEvangelist David Pine (IEvangelist) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs accuracy review: Phase A (claims) and Phase B (doc-tester)

Sources used in Phase A

  • CommunityToolkit/Aspire @ main 9767a4d3828000df210ddfd9d90c259c40b57dd2. This is the integration's home repo, and the PR targets main.
  • microsoft/aspire @ main 2e31a5b70f3786ecec52d8fa4101b121f6142319, for the Aspire CLI, deployment state and Docker Compose claims.
  • Azure/azure-sdk-for-net wasn't needed.

Claims extracted: 44 non-narrative claims, plus narrative prose.

Verdict Count
verified 37
verified-with-nuance 6
unverifiable 0
contradicted 1

Phase B: I served the PR head 4186403 locally with bun run dev and checked 4 routes plus the sidebar. There were 0 critical issues and 9 warnings.

Most of this PR matches the toolkit code closely. The API shapes, plan lines, pipeline step names, environment variable names, certificate precedence and destroy safety rules all line up. The one contradiction is in the Installation guidance about how a release quality CLI discovers prerelease packages; see the inline comment.


Phase A: Claim verification

Contradicted (1)

  • ravendb-cloud.mdx:40: the page says a release quality CLI "select[s] only stable releases". aspire add actually always searches the implicit channel, which is PackageChannelQuality.Both. Details are in the inline comment.
Verified-with-nuance (6)
  1. release channel "change" line lists the things RavenDB Cloud can change. Correct.
    • Nuance: a disk growth to a size the product doesn't list in AvailableDiskSizes is also impossible, not just a shrink (RavenDBCloudPlan.cs:213-219).
  2. unreachable plan line. It's only produced when the product exists, is Active, and the plan isn't already blocked (RavenDBCloudPipelineSteps.cs:213-215, 258-267).
  3. ConnectionStrings__<name> is "the URLs of the product's nodes, separated by commas … and the database".
    • URLs are joined with , (RavenDBCloudProducts.cs:318), and the server's connection string is URL=... (Hosting.RavenDB/RavenDBServerResource.cs:72).
    • ;Database= is only appended for a database reference (RavenDBDatabaseResource.cs:27). A reference to the server itself gets no database.
  4. Destroy step "terminates the product when asked". It only revokes certificates when the product is left running (RavenDBCloudPipelineSteps.cs:131-142). That's fine, but "Revokes the certificates in aspire destroy" doesn't apply when the product is terminated.
  5. TypeScript cloud.terminateOnDestroy.set(true). RavenDBCloudOptions has [AspireExport(ExposeProperties = true, ExposeMethods = true)] (RavenDBCloudOptions.cs:58), so the property is exported. The .set() shape matches the repo's other exported-property samples, but the toolkit's TS tests don't exercise it.
  6. "Keys expire after at most 12 months." This is RavenDB Cloud service behavior, so it can't be checked in code. The toolkit README says the same (README.md:18).
Verified (37)

API shape (CommunityToolkit/Aspire)

  • PublishAsRavenDBCloud(apiKey, productName, RavenDBCloudSpec spec, Action<RavenDBCloudOptions>? configure) for C#. The Action<RavenDBCloudSpecBuilder> overload is the one exported to TypeScript (RavenDBCloudBuilderExtensions.cs:47-52, 84-90).

  • PublishAsExistingRavenDBCloud(apiKey, productName, clientName, configure?) is exported to TypeScript (RavenDBCloudBuilderExtensions.cs:126-132).

  • RavenDBCloudSpec.Production / Development take (provider, region, instanceType, diskSizeInGb, storageType, diskLayout, releaseChannel, iops?, throughput?), and the TS spec.production(...) / spec.development(...) mirror them (RavenDBCloudSpec.cs:84-118, 183-205).

  • Enums:

    • RavenDBCloudProvider.Azure/Aws/Gcp
    • RavenDBCloudStorageType.SsdStandard/SsdPremium
    • RavenDBCloudDiskLayout.SingleDataDisk/RootOnly

    (RavenDBCloudOptions.cs:6-52)

  • Options:

    • WithAllowedIps(params string[]) (RavenDBCloudOptions.cs:89)
    • TerminateOnDestroy, off by default (:83)
  • The C# using CommunityToolkit.Aspire.Hosting.RavenDB.Cloud; namespace is correct for the spec types and enums.

  • The TS and C# samples match the toolkit's own examples, examples/ravendb/...TypeScript/apphost.mts and RavenDB.Cloud.AppHost/AppHost.cs.

  • addDatabase(name, { ensureCreated }) exists (Hosting.RavenDB/RavenDBBuilderExtensions.cs:246).

  • The package is a preview (IsPreview=true in the csproj).

Behavior

  • Tier semantics are right: Development is one node with no automatic backups, Production is three nodes with automatic backups (RavenDBCloudSpec.cs:73, 99).
  • Nothing in the spec has a default (RavenDBCloudSpec.cs:6-7).
  • Plan lines create, no changes, change, impossible, allowed IPs and no target all match the code (RavenDBCloudPlan.cs:150-286, 413-461). The impossible set is tier, provider, region, release channel, disk layout and disk shrink.
  • The "not offered … Offered:" output sample matches the format string (RavenDBCloudPlan.cs:370-371).
  • Approval:
    • The variable is RavenDB__Cloud__ApproveChanges (RavenDBCloudPlan.cs:523).
    • It's read only from the process environment via Environment.GetEnvironmentVariable (RavenDBCloudEnvironment.cs:18, RavenDBCloudPipelineSteps.cs:239).
  • Allowed IPs:
    • They're set only at creation, and at least one is required (RavenDBCloudPlan.cs:290-298).
    • Missing ranges block the deployment (:413-431).
    • The wide-range warning fires for IPv4 wider than /16 and IPv6 wider than /48 (:85).
  • Attached products are never created, changed or terminated, and setting TerminateOnDestroy on one throws (RavenDBCloudBuilderExtensions.cs:148-153).
  • Before terminating, destroy refuses a product whose tier, provider, region, release channel or instance type differ (RavenDBCloudProducts.cs:113-118, 148-168).
  • Certificates:
    • Each app's certificate has Admin access only to the databases it references (RavenDBCloudCertificates.cs:24-38).
    • New certificates are issued on every deploy, and the old ones are revoked after all the deploy steps (RavenDBCloudPipelineSteps.cs:179-187).
  • The env vars Aspire__RavenDB__Client__<name>__CertificateBase64 exist, plus the default section when the app references only one server (Shared/RavenDB/RavenDBClientConfiguration.cs:16-52).
  • Client:
    • Certificate precedence is Certificate, then CertificateBase64, then CertificatePath (RavenDB.Client/RavenDBClientSettings.cs, GetCertificate).
    • Comma-separated URLs are split (RavenDBClientExtension.cs:254).
  • ensureCreated databases are created by the databases step (RavenDBCloudPipelineSteps.cs:72-90).
  • Docker Compose is the only supported environment (RavenDBCloudPlan.cs:54-57).
  • Free products can't be created via the API (RavenDBCloudOptions.cs:19-21).

CLI and pipeline

  • The six step names ravendb-cloud-{plan,provision,databases,certificates,cleanup,destroy}-<server> match (RavenDBCloudPipelineSteps.cs:15-33).
  • The plan step runs before deploy-prereq (:49).

microsoft/aspire

  • aspire deploy --clear-cache exists (Aspire.Cli/Commands/DeployCommand.cs:27).
  • Deployment state is skipped only when ClearCache is set; otherwise it's layered into configuration after the environment variables, so the saved value wins (Aspire.Hosting/DistributedApplicationBuilder.cs:1209-1243).
  • Docker Compose writes aspire-output/.env.<environment> (Aspire.Hosting.Docker/DockerComposeEnvironmentResource.cs:602, Pipelines/PipelineOutputService.cs:39).
  • The parameter key is Parameters:{name}, and dashes aren't normalized, so Parameters__ravendb-cloud-api-key is the correct env var name (ApplicationModel/ParameterResource.cs:176).
  • Aspire.Cli is a .NET tool with command aspire (Aspire.Cli.csproj:57-58).
  • aspire do and aspire add --version exist.

Phase B: Doc-tester results (reported as-is)

Local URL: http://localhost:4321/, PR head 4186403.

Routes:

  • /integrations/databases/ravendb/ravendb-cloud/
  • /integrations/databases/ravendb/ravendb-get-started/
  • /integrations/databases/ravendb/ravendb-host/
  • /integrations/databases/ravendb/ravendb-connect/
  • the sidebar

The tester didn't run any samples, because there's no RavenDB Cloud account.

Critical issues: None. There are no broken links, missing anchors or rendering failures.

Warnings

  1. Env var naming conflicts with another page. /fundamentals/external-parameters/ says dashes in parameter names become a single underscore (Parameters__registry_endpoint). The cloud page uses Parameters__ravendb-cloud-api-key, so a new user can't tell which form is right.
    • Reviewer note: Phase A verified that the dash form is correct for this parameter, so the inconsistency is on the unchanged page. A one-line clarification on the cloud page would still help.
  2. Key rotation in CI is unclear. /deployment/deployment-state-caching/ says --clear-cache prompts and doesn't save the prompted values. The CI sample uses --non-interactive, so it isn't clear how to do the one-off clear in CI, or whether the next deploy saves the new key.
  3. "What apps receive" only covers .NET configuration keys. /ravendb-connect/ tells Go, Python and TS apps to read RAVENDB_URI and RAVENDB_DATABASE. The page doesn't say whether those are set in a Cloud deployment, or how a non-.NET app loads the certificate.
  4. Get-started intro is stale. It still says "Getting there is a two-step process", but the list now has 3 steps, and the new one is optional.
  5. The approval command is bash-only. RavenDB__Cloud__ApproveChanges=true aspire deploy has no PowerShell or cmd equivalent.
  6. TS and C# samples differ in shape without explanation.
    • The TS spec is a callback and the options go in { configure }; C# passes a value and a positional lambda.
    • Some TS positional arguments have no comments (provider, storage type, layout).
    • The Destroy snippets are bare fragments with no surrounding call.
  7. Inconsistent TS style. The Destroy TS snippet uses double quotes and 4-space indentation, while the main sample uses single quotes and 2 spaces. The main sample also ends with a comment instead of await builder.build().run();, which the host page uses.
  8. No Go tab. The host page has TS, C# and Go tabs, and the cloud page doesn't say whether Go AppHosts are supported.
  9. CI sample assumes a .NET AppHost. It only sets up .NET, so a TS AppHost would presumably also need Node.

Passed checks

  • All tabs, asides, tables (6 plan rows and 6 step rows) and code titles render on /ravendb-cloud/.
  • All relative links work: ../ravendb-host/, ../ravendb-connect/ and ../ravendb-cloud/.
  • The #known-limitations and #network-access anchors resolve, as do all absolute internal links, including /reference/cli/install-script/#options.
  • Get-started step 3 and its LinkButton work.
  • The host page's "Deploy to RavenDB Cloud" section renders.
  • The connect page's cluster sentence and "Client certificate" paragraph render.
  • The sidebar order is right: Get started, Set up, Connect, Deploy to RavenDB Cloud.
  • --clear-cache, aspire do, the install-script qualities and dotnet tool install -g Aspire.Cli are all documented elsewhere on the site.
  • The only console error is a /api/live 404, which is unrelated to this PR.

Recommendations

  1. Make the parameter env-var form agree across pages.
  2. Say what non-.NET consumers receive.
  3. Fix "two-step process".
  4. Add a PowerShell form of the approval command: $env:RavenDB__Cloud__ApproveChanges='true'; aspire deploy.
  5. Show the Destroy option inside a full publish call.
  6. Comment every positional TS argument and align the TS style.
  7. State the minimum CommunityToolkit.Aspire.RavenDB.Client version that reads CertificateBase64, not just "older versions".
  8. Explain the one-off --clear-cache in non-interactive CI.
  9. State Go AppHost support.
  10. Show the Development factory or the IOPS and throughput options.
  11. Make the sample plan output match the sample spec: the output shows Dev99 on AWS eu-central-1, while the sample uses Azure westeurope P20.

Knowledge gaps

  • Where the per-environment .env.<environment> file comes from; /deployment/docker-compose/ only mentions an unfilled .env.
  • What a "RavenDB Cloud product", tier, instance type and release channel are. A one-line definition early on would help.
  • The __ env-var convention isn't linked to /fundamentals/external-parameters/.
  • The page doesn't say explicitly that aspire do ravendb-cloud-plan-<name> changes nothing.

Verdict: REQUEST_CHANGES. There's one contradicted claim, the Installation guidance about the release CLI. Everything else is warnings and nice-to-haves.


## Installation

Install the [📦 CommunityToolkit.Aspire.Hosting.RavenDB.Cloud](https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.RavenDB.Cloud) NuGet package in the AppHost. The package ships only prerelease versions, while a `release` quality CLI and the `*` version that most package references use select only stable releases, so name a prerelease version:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contradicted (Phase A). This sentence says a release quality CLI selects only stable releases. That isn't how aspire add works today. The part about * floating versions is accurate.

In microsoft/aspire @ 2e31a5b (main):

  • aspire add always searches the implicit channel, and that channel is PackageChannelQuality.Both precisely so Community Toolkit prerelease packages show up (src/Aspire.Cli/Packaging/PackageChannel.cs:1139-1146).

    "The reason that PackageChannelQuality.Both is because there are situations like in community toolkit where there is a newer beta version available for a package"

  • src/Aspire.Cli/Packaging/IntegrationPackageSearchService.cs:191-199 says the implicit channel "must always participate so prerelease packages are reachable even when the explicit pin is Stable-quality". It cites aspire add kube adds first matching integration instead of failing aspire#17724 and Prerelease-only integrations like Aspire.Hosting.Foundry are filtered out of search aspire#17725, which were about prerelease-only packages like Aspire.Hosting.Foundry.
  • src/Aspire.Cli/Commands/AddCommand.cs:783-790: with no pinned channel, aspire add orders the implicit channel first, then by the highest SemVer. So a prerelease-only package resolves without --version.

Suggested fix: drop the "release quality CLI … select only stable releases" clause and the staging/dev remark on line 65. aspire add CommunityToolkit.Aspire.Hosting.RavenDB.Cloud should work as-is. Keep the note that a manual <PackageReference> needs an explicit prerelease version, since Version="*" doesn't float to prereleases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DOT NOT MERGE This should not be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants