Repository navigation
Document the Community Toolkit RavenDB Cloud hosting integration - #2287
Gracjan Sadowicz (poissoncorp) wants to merge 2 commits into
Conversation
|
@microsoft-github-policy-service agree company="RavenDB Ltd" |
There was a problem hiding this comment.
🟡 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 |
There was a problem hiding this comment.
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="*" /> |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
|
Hi Gracjan Sadowicz (@poissoncorp), thanks for the PR. Can we flip this to a draft until the NuGet package is available? |
David Pine (IEvangelist)
left a comment
There was a problem hiding this comment.
Docs accuracy review: Phase A (claims) and Phase B (doc-tester)
Sources used in Phase A
CommunityToolkit/Aspire@main9767a4d3828000df210ddfd9d90c259c40b57dd2. This is the integration's home repo, and the PR targetsmain.microsoft/aspire@main2e31a5b70f3786ecec52d8fa4101b121f6142319, for the Aspire CLI, deployment state and Docker Compose claims.Azure/azure-sdk-for-netwasn'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 areleasequality CLI "select[s] only stable releases".aspire addactually always searches the implicit channel, which isPackageChannelQuality.Both. Details are in the inline comment.
Verified-with-nuance (6)
releasechannel "change" line lists the things RavenDB Cloud can change. Correct.- Nuance: a disk growth to a size the product doesn't list in
AvailableDiskSizesis alsoimpossible, not just a shrink (RavenDBCloudPlan.cs:213-219).
- Nuance: a disk growth to a size the product doesn't list in
unreachableplan line. It's only produced when the product exists, isActive, and the plan isn't already blocked (RavenDBCloudPipelineSteps.cs:213-215, 258-267).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 isURL=...(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.
- URLs are joined with
- 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 inaspire destroy" doesn't apply when the product is terminated. - TypeScript
cloud.terminateOnDestroy.set(true).RavenDBCloudOptionshas[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. - "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#. TheAction<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/Developmenttake(provider, region, instanceType, diskSizeInGb, storageType, diskLayout, releaseChannel, iops?, throughput?), and the TSspec.production(...)/spec.development(...)mirror them (RavenDBCloudSpec.cs:84-118, 183-205). -
Enums:
RavenDBCloudProvider.Azure/Aws/GcpRavenDBCloudStorageType.SsdStandard/SsdPremiumRavenDBCloudDiskLayout.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.mtsandRavenDB.Cloud.AppHost/AppHost.cs. -
addDatabase(name, { ensureCreated })exists (Hosting.RavenDB/RavenDBBuilderExtensions.cs:246). -
The package is a preview (
IsPreview=truein 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 IPsandno targetall match the code (RavenDBCloudPlan.cs:150-286, 413-461). Theimpossibleset 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).
- The variable is
- 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).
- They're set only at creation, and at least one is required (
- Attached products are never created, changed or terminated, and setting
TerminateOnDestroyon 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).
- Each app's certificate has Admin access only to the databases it references (
- The env vars
Aspire__RavenDB__Client__<name>__CertificateBase64exist, plus the default section when the app references only one server (Shared/RavenDB/RavenDBClientConfiguration.cs:16-52). - Client:
- Certificate precedence is
Certificate, thenCertificateBase64, thenCertificatePath(RavenDB.Client/RavenDBClientSettings.cs,GetCertificate). - Comma-separated URLs are split (
RavenDBClientExtension.cs:254).
- Certificate precedence is
ensureCreateddatabases 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-cacheexists (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, soParameters__ravendb-cloud-api-keyis the correct env var name (ApplicationModel/ParameterResource.cs:176). Aspire.Cliis a .NET tool with commandaspire(Aspire.Cli.csproj:57-58).aspire doandaspire add --versionexist.
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
- 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 usesParameters__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.
- Key rotation in CI is unclear.
/deployment/deployment-state-caching/says--clear-cacheprompts 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. - "What apps receive" only covers .NET configuration keys.
/ravendb-connect/tells Go, Python and TS apps to readRAVENDB_URIandRAVENDB_DATABASE. The page doesn't say whether those are set in a Cloud deployment, or how a non-.NET app loads the certificate. - 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.
- The approval command is bash-only.
RavenDB__Cloud__ApproveChanges=true aspire deployhas no PowerShell or cmd equivalent. - 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.
- The TS spec is a callback and the options go in
- 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. - No Go tab. The host page has TS, C# and Go tabs, and the cloud page doesn't say whether Go AppHosts are supported.
- 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-limitationsand#network-accessanchors 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 anddotnet tool install -g Aspire.Cliare all documented elsewhere on the site.- The only console error is a
/api/live404, which is unrelated to this PR.
Recommendations
- Make the parameter env-var form agree across pages.
- Say what non-.NET consumers receive.
- Fix "two-step process".
- Add a PowerShell form of the approval command:
$env:RavenDB__Cloud__ApproveChanges='true'; aspire deploy. - Show the Destroy option inside a full publish call.
- Comment every positional TS argument and align the TS style.
- State the minimum
CommunityToolkit.Aspire.RavenDB.Clientversion that readsCertificateBase64, not just "older versions". - Explain the one-off
--clear-cachein non-interactive CI. - State Go AppHost support.
- Show the Development factory or the IOPS and throughput options.
- Make the sample plan output match the sample spec: the output shows
Dev99on AWSeu-central-1, while the sample uses AzurewesteuropeP20.
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: |
There was a problem hiding this comment.
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 addalways searches the implicit channel, and that channel isPackageChannelQuality.Bothprecisely 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-199says 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 likeAspire.Hosting.Foundry.src/Aspire.Cli/Commands/AddCommand.cs:783-790: with no pinned channel,aspire addorders 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.

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 runkeeps the local RavenDB container, whileaspire deploycreates 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 withPublishAsRavenDBCloud, 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 inURL, and the client certificate asCertificateBase64.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.Cloudmapping tointegration-docs.jsonthen, since theupdate-integrationstests 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
astro dev. They return 200 and show the tabs, asides and the sidebar entry.update-integrations.vitest.test.tsanddev-resource-catalog.vitest.test.ts: 75 passed..github/forbidden-words.json.