Skip to content

Add onboarding, deployment, and security documentation#129

Merged
sfmskywalker merged 11 commits into
mainfrom
copilot/add-onboarding-deployment-docs
Dec 2, 2025
Merged

Add onboarding, deployment, and security documentation#129
sfmskywalker merged 11 commits into
mainfrom
copilot/add-onboarding-deployment-docs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 2, 2025

Implementation: Add Onboarding and Deployment Documentation ✅

This PR implements "PR 5" from the planning document, adding comprehensive onboarding, deployment, integration, and security documentation to address issues #6, #75, #87, #15, and #16.

Summary

Added five new comprehensive documentation files totaling 3,452 lines of documentation with all PR review feedback addressed.

Latest Updates - Addressing All PR Review Feedback ✅

All 8 PR Review Comments Addressed:

  1. ✅ Fixed syntax error in Blazor dashboard (removed extra closing braces on lines 635-636)
  2. ✅ Added warning about dotnet-ef requirement for init container migrations
  3. ✅ Fixed hyphenation inconsistency ("Quick-start" → "Quick start")
  4. ✅ Updated hardcoded version numbers (3.3.0 → x.y.z with note to check NuGet)
  5. ✅ Fixed DisableAuthorization troubleshooting to match actual API patterns
  6. ✅ Improved SUMMARY.md navigation flow and removed duplicate entries
  7. ✅ Added warning about dotnet-ef requirement for Kubernetes Job migrations
  8. ✅ Fixed null reference risk in OIDC scopes foreach loop

Documentation Files

  1. Hosting Elsa in an Existing App (655 lines) - Addresses issue Significant Onboarding Gaps #6

    • Step-by-step ASP.NET Core integration
    • EF Core persistence setup (PostgreSQL, SQL Server, SQLite)
    • Solutions for common pain points (DbContextOptions, version conflicts, Swagger issues)
  2. Kubernetes Deployment Basics (908+ lines) - Addresses issue k8s deployment issue #75

    • PostgreSQL configuration for production
    • Module-level provider configuration requirements
    • Migration strategies with proper warnings about EF tooling
    • Comprehensive troubleshooting section
  3. Blazor Dashboard Integration (729 lines) - Addresses issue [DOC] Detailed procedures to integrate Elas dashboard with .net 8.0 Blazor apps  #87

    • Hosting patterns with corrected syntax
    • Secure cookie forwarding implementation
    • Authentication troubleshooting
  4. Disable Auth in Development (523 lines) - Addresses issue How to disable authentication for Elsa Server + Elsa Studio #15

    • Multiple methods for disabling authentication
    • Corrected troubleshooting examples
  5. External Identity Providers (586 lines) - Partially addresses issue Third party Identity Provider Integration #16

    • OIDC/OAuth2 integration patterns with safe null handling
    • Provider-specific sections

Issues Addressed

Original prompt

Implement "PR 5" from our prior planning for elsa-workflows/elsa-gitbook.

Goal: Add onboarding and deployment documentation to help users integrate Elsa into existing ASP.NET Core applications, deploy to Kubernetes (including PostgreSQL configuration), and understand basic authentication options (including how to disable auth in dev and how to integrate with external identity later). This should directly address pain points raised in issues #6, #75, #87, #15, and partially #16.

Repository: elsa-workflows/elsa-gitbook
Base branch: main

Requirements:

  1. Onboarding guide for hosting Elsa in an existing ASP.NET Core app (issue Significant Onboarding Gaps #6)

    • New file: guides/onboarding/hosting-elsa-in-existing-app.md.
    • Content:
      • Step-by-step instructions to add Elsa to an existing ASP.NET Core project:
        • Install core Elsa packages.
        • Call services.AddElsa(...) / module configuration in Program.cs.
        • Configure persistence (with an example for PostgreSQL or SQL Server using EF Core, based on current elsa-core patterns).
      • Explicitly call out and explain common pain points mentioned in issue Significant Onboarding Gaps #6:
        • DbContextOptions<T> requirement for AppDbContext when using EF Core.
        • Version pinning conflicts (e.g., Hangfire, Microsoft.EntityFrameworkCore.Design / CodeAnalysis dependencies) and strategies to resolve them.
        • Swagger / Swashbuckle schema issues with Elsa endpoints (e.g., schemaId conflicts) and simple workarounds (exclude certain endpoints, customize SchemaId).
      • High-level description only for auth; full auth docs will be elsewhere.
  2. Kubernetes deployment basics with PostgreSQL (issue k8s deployment issue #75)

    • New file: guides/deployment/kubernetes.md.
    • Content:
      • Describe the provided scripts/ Kubernetes manifests in elsa-core (if present) at a high level.
      • Show how to switch the default SQLite configuration to PostgreSQL when deploying to Kubernetes:
        • Environment variables to set (connection string, provider hints).
        • Any required module/persistence configuration in appsettings or Program.cs.
      • Explain why changing only a single connection string may not be enough (modules also need correct provider configuration).
      • Include a troubleshooting section:
        • How to confirm Elsa is using PostgreSQL instead of SQLite (logs, DB tables).
        • Common misconfigurations (wrong env var names, appsettings not mounted, missing EF provider package).
  3. Blazor dashboard integration basics (issue [DOC] Detailed procedures to integrate Elas dashboard with .net 8.0 Blazor apps  #87)

    • New file: guides/integration/blazor-dashboard.md.
    • Content:
      • Focus first on Blazor Server integration (simpler hosting model).
      • Describe common patterns:
        • Hosting Elsa Server endpoints in the same ASP.NET Core process as the Blazor app vs hosting Elsa as a separate service.
        • How to configure authentication so Studio → Elsa Server requests are authorized (cookie auth vs bearer tokens at a high level, no deep auth config).
      • Explain where login/401 issues typically come from:
        • Mismatched auth scheme.
        • Missing tokens / cookies forwarded from the Blazor app to Elsa endpoints.
      • Provide a minimal conceptual example:
        • Blazor Server app that references Elsa packages and exposes Elsa endpoints under /elsa.
        • Notes on configuring the Blazor app's authentication to also apply to Elsa endpoints.
      • Point users to security/identity docs for detailed auth setup and external providers.
  4. Disable auth in dev (issue How to disable authentication for Elsa Server + Elsa Studio #15)

    • New file: guides/security/disable-auth.md.
    • Content:
      • Explain that in development you may want to disable authentication for Elsa Server + Studio to simplify experimentation.
      • Show high-level options:
        • Disabling or bypassing Elsa Identity module if enabled.
        • Registering a very permissive authorization policy/handler that allows all requests (with clear warnings).
      • Emphasize this is not for production use.
      • Refer to upcoming/other docs for proper auth and external identity provider integration.
  5. External identity providers stub (partial issue Third party Identity Provider Integration #16)

    • New file: guides/security/external-identity-providers.md.
    • Content:
      • High-level overview of integrating Elsa Server with external identity providers (Azure AD, Auth0, OpenIddict, etc.).
      • Describe the general pattern (ASP.NET Core authentication/authorization middleware, OpenID Connect/OAuth2).
      • Stub out planned sections for specific providers without going into full implementation detail in this PR.
      • Link from here to Blazor integration and running workflows via REST docs where appropriate.
  6. Navigation updates

    • Update SUMMARY.md to add:
      • Under a suitable section (e.g., Guides → Onboarding):
        • guides/onboarding/hosting-elsa-in-existing-app.md (e.g., "Hosting Elsa in an existing app").
      • Under a Deployment or Guides section:
        • `guides/deployment/kubernetes.m...

This pull request was created as a result of the following prompt from Copilot chat.

Implement "PR 5" from our prior planning for elsa-workflows/elsa-gitbook.

Goal: Add onboarding and deployment documentation to help users integrate Elsa into existing ASP.NET Core applications, deploy to Kubernetes (including PostgreSQL configuration), and understand basic authentication options (including how to disable auth in dev and how to integrate with external identity later). This should directly address pain points raised in issues #6, #75, #87, #15, and partially #16.

Repository: elsa-workflows/elsa-gitbook
Base branch: main

Requirements:

  1. Onboarding guide for hosting Elsa in an existing ASP.NET Core app (issue Significant Onboarding Gaps #6)

    • New file: guides/onboarding/hosting-elsa-in-existing-app.md.
    • Content:
      • Step-by-step instructions to add Elsa to an existing ASP.NET Core project:
        • Install core Elsa packages.
        • Call services.AddElsa(...) / module configuration in Program.cs.
        • Configure persistence (with an example for PostgreSQL or SQL Server using EF Core, based on current elsa-core patterns).
      • Explicitly call out and explain common pain points mentioned in issue Significant Onboarding Gaps #6:
        • DbContextOptions<T> requirement for AppDbContext when using EF Core.
        • Version pinning conflicts (e.g., Hangfire, Microsoft.EntityFrameworkCore.Design / CodeAnalysis dependencies) and strategies to resolve them.
        • Swagger / Swashbuckle schema issues with Elsa endpoints (e.g., schemaId conflicts) and simple workarounds (exclude certain endpoints, customize SchemaId).
      • High-level description only for auth; full auth docs will be elsewhere.
  2. Kubernetes deployment basics with PostgreSQL (issue k8s deployment issue #75)

    • New file: guides/deployment/kubernetes.md.
    • Content:
      • Describe the provided scripts/ Kubernetes manifests in elsa-core (if present) at a high level.
      • Show how to switch the default SQLite configuration to PostgreSQL when deploying to Kubernetes:
        • Environment variables to set (connection string, provider hints).
        • Any required module/persistence configuration in appsettings or Program.cs.
      • Explain why changing only a single connection string may not be enough (modules also need correct provider configuration).
      • Include a troubleshooting section:
        • How to confirm Elsa is using PostgreSQL instead of SQLite (logs, DB tables).
        • Common misconfigurations (wrong env var names, appsettings not mounted, missing EF provider package).
  3. Blazor dashboard integration basics (issue [DOC] Detailed procedures to integrate Elas dashboard with .net 8.0 Blazor apps  #87)

    • New file: guides/integration/blazor-dashboard.md.
    • Content:
      • Focus first on Blazor Server integration (simpler hosting model).
      • Describe common patterns:
        • Hosting Elsa Server endpoints in the same ASP.NET Core process as the Blazor app vs hosting Elsa as a separate service.
        • How to configure authentication so Studio → Elsa Server requests are authorized (cookie auth vs bearer tokens at a high level, no deep auth config).
      • Explain where login/401 issues typically come from:
        • Mismatched auth scheme.
        • Missing tokens / cookies forwarded from the Blazor app to Elsa endpoints.
      • Provide a minimal conceptual example:
        • Blazor Server app that references Elsa packages and exposes Elsa endpoints under /elsa.
        • Notes on configuring the Blazor app's authentication to also apply to Elsa endpoints.
      • Point users to security/identity docs for detailed auth setup and external providers.
  4. Disable auth in dev (issue How to disable authentication for Elsa Server + Elsa Studio #15)

    • New file: guides/security/disable-auth.md.
    • Content:
      • Explain that in development you may want to disable authentication for Elsa Server + Studio to simplify experimentation.
      • Show high-level options:
        • Disabling or bypassing Elsa Identity module if enabled.
        • Registering a very permissive authorization policy/handler that allows all requests (with clear warnings).
      • Emphasize this is not for production use.
      • Refer to upcoming/other docs for proper auth and external identity provider integration.
  5. External identity providers stub (partial issue Third party Identity Provider Integration #16)

    • New file: guides/security/external-identity-providers.md.
    • Content:
      • High-level overview of integrating Elsa Server with external identity providers (Azure AD, Auth0, OpenIddict, etc.).
      • Describe the general pattern (ASP.NET Core authentication/authorization middleware, OpenID Connect/OAuth2).
      • Stub out planned sections for specific providers without going into full implementation detail in this PR.
      • Link from here to Blazor integration and running workflows via REST docs where appropriate.
  6. Navigation updates

    • Update SUMMARY.md to add:
      • Under a suitable section (e.g., Guides → Onboarding):
        • guides/onboarding/hosting-elsa-in-existing-app.md (e.g., "Hosting Elsa in an existing app").
      • Under a Deployment or Guides section:
        • guides/deployment/kubernetes.md (e.g., "Kubernetes").
      • Under a Security section:
        • guides/security/disable-auth.md.
        • guides/security/external-identity-providers.md.
      • Under an Integration section (if present) or Guides:
        • guides/integration/blazor-dashboard.md.
  7. Scope and style

    • Follow existing Markdown style in elsa-gitbook (headings, admonitions, code fences, etc.).
    • Keep all examples conceptual and safe: no hard-coded secrets or environment-specific values.
    • Do not attempt to fully document all external identity provider setups; just provide a clear landing page and outline.
    • Validate any code snippets or configuration patterns against current elsa-core and elsa-samples projects.

Deliverables:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits December 2, 2025 19:22
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
Copilot AI changed the title [WIP] Add onboarding and deployment documentation for ASP.NET Core Add onboarding, deployment, and security documentation Dec 2, 2025
Copilot AI requested a review from sfmskywalker December 2, 2025 19:36
@sfmskywalker sfmskywalker marked this pull request as ready for review December 2, 2025 19:40
Copilot AI review requested due to automatic review settings December 2, 2025 19:40
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +244 to +255
**elsa-configmap.yaml:**
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: elsa-config
data:
appsettings.Production.json: |
{
"ConnectionStrings": {
"PostgreSql": "Host=postgres;Database=elsa_workflows;Username=elsa_user;Password=$(POSTGRES_PASSWORD)"
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge ConfigMap connection string never resolves secret

The ConfigMap example writes "Password=$(POSTGRES_PASSWORD)" directly into appsettings.Production.json, but Kubernetes does not substitute env vars inside ConfigMap file content and the default .NET configuration provider will read the literal string. Following this snippet results in the app trying to log into PostgreSQL with the password $(POSTGRES_PASSWORD) and failing authentication; the secret is never applied. The connection string needs to be built from an env var at runtime or injected via Secret/ValueFrom rather than embedded as a placeholder in the JSON.

Useful? React with 👍 / 👎.

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.

@copilot Please address this comment.

Comment on lines +260 to +263
# Add a migration
dotnet ef migrations add InitialElsa --context ManagementElsaDbContext
dotnet ef migrations add InitialElsaRuntime --context RuntimeElsaDbContext

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge EF migration commands reuse the same name for two contexts

The production migration instructions run dotnet ef migrations add InitialElsa for both ManagementElsaDbContext and RuntimeElsaDbContext. EF Core requires migration names to be unique per assembly, so the second command will fail with “A migration named 'InitialElsa' already exists” (or overwrite the first migration if forced). Users following these steps cannot create migrations for both contexts. Use distinct names or separate output folders for each context.

Useful? React with 👍 / 👎.

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.

@copilot Please address this comment.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive onboarding, deployment, and security documentation to help users integrate Elsa Workflows into their applications. It addresses several community-reported issues with detailed, practical guides totaling 3,452 lines of new documentation.

Key Changes:

  • Onboarding guide for integrating Elsa into existing ASP.NET Core applications, including detailed solutions for common pain points like DbContext conflicts and Swagger schema issues
  • Kubernetes deployment guide with PostgreSQL configuration, explaining why connection strings alone are insufficient and providing troubleshooting for common misconfigurations
  • Security guides covering both disabling authentication for development and integrating with external identity providers (Microsoft Entra ID, Auth0, Keycloak)

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
SUMMARY.md Adds navigation entries for new Onboarding, Deployment, Integration, and Security sections
guides/onboarding/hosting-elsa-in-existing-app.md Comprehensive guide for adding Elsa to existing ASP.NET Core apps with solutions to DbContextOptions conflicts, version pinning issues, and Swagger schema conflicts
guides/onboarding/README.md Index page for onboarding section
guides/deployment/kubernetes.md Detailed Kubernetes deployment guide with PostgreSQL setup, explaining module-level provider configuration and troubleshooting connection/migration issues
guides/deployment/README.md Index page for deployment section
guides/integration/blazor-dashboard.md Guide for integrating Elsa Studio with Blazor Server, covering hosting patterns and authentication configuration
guides/integration/README.md Index page for integration section
guides/security/disable-auth.md Development-focused guide for disabling authentication with clear production warnings and multiple configuration approaches
guides/security/external-identity-providers.md Foundational guide for OIDC/OAuth2 integration with provider-specific examples for Microsoft Entra ID, Auth0, and Keycloak

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread guides/integration/blazor-dashboard.md Outdated
Comment on lines +614 to +636
// Note: Only forward to the same domain or explicitly trusted domains
var cookies = httpContext.Request.Headers["Cookie"].FirstOrDefault();
if (!string.IsNullOrEmpty(cookies) && IsElsaServerTrusted(client.BaseAddress))
{
// Filter to only authentication-related cookies if needed
client.DefaultRequestHeaders.TryAddWithoutValidation("Cookie", cookies);
}
}
});
});

// Helper method to validate Elsa Server is trusted
bool IsElsaServerTrusted(Uri baseAddress)
{
// Only forward cookies to same origin or explicitly configured trusted domains
var trustedDomains = builder.Configuration.GetSection("ElsaServer:TrustedDomains").Get<string[]>()
?? Array.Empty<string>();

return trustedDomains.Contains(baseAddress.Host, StringComparer.OrdinalIgnoreCase)
|| baseAddress.Host == "localhost"
|| baseAddress.Host == "127.0.0.1";
});
});
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

The cookie forwarding example forwards all cookies to potentially untrusted domains. The IsElsaServerTrusted helper method is defined but the closing braces are incorrect - there are two extra closing braces on lines 635-636 that create invalid syntax. Additionally, the validation logic should be more explicit about only forwarding authentication-specific cookies, not all cookies which could include session tokens or other sensitive data.

Copilot uses AI. Check for mistakes.
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.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit fe6fda0. Removed the two extra closing braces on lines 635-636 that were causing the syntax error.

Comment thread guides/deployment/kubernetes.md
Comment thread guides/deployment/kubernetes.md Outdated
Comment thread guides/onboarding/hosting-elsa-in-existing-app.md Outdated
Comment thread guides/security/disable-auth.md Outdated
Comment on lines +479 to +481
studio.DisableAuthorization = true; // Development only
});
```
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

The troubleshooting suggestion references a DisableAuthorization property on Studio configuration, but this property is not shown in any of the earlier code examples in the document. If this property exists, it should be demonstrated in the main configuration examples. If it doesn't exist or is hypothetical, the suggestion should be clarified or corrected.

Copilot uses AI. Check for mistakes.
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.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit fe6fda0. Replaced the incorrect DisableAuthorization property reference with the correct pattern shown in earlier examples (ConfigureHttpClient with no authentication).

Comment thread SUMMARY.md
Comment on lines +487 to +501
command: ["/bin/sh", "-c"]
args:
- |
dotnet ef database update --context ManagementElsaDbContext
dotnet ef database update --context RuntimeElsaDbContext
env:
- name: ConnectionStrings__PostgreSql
value: "Host=postgres;Database=elsa_workflows;Username=elsa_user;Password=$(POSTGRES_PASSWORD)"
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-secret
key: password
restartPolicy: OnFailure
```
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

Similar to the init container example, the migration Job assumes the Elsa Server image includes EF Core tooling (dotnet ef). This is often not the case in production images. Consider adding a note that this approach requires the dotnet-ef tool to be installed in the image, or recommend using a separate migration image that includes the necessary tooling.

Copilot uses AI. Check for mistakes.
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.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added the warning in commit fe6fda0. Similar to the init container, the Job example now includes a clear warning about the dotnet-ef requirement.

Comment thread guides/security/external-identity-providers.md Outdated
sfmskywalker and others added 6 commits December 2, 2025 20:48
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… warnings

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
@sfmskywalker sfmskywalker merged commit 6b2a383 into main Dec 2, 2025
5 checks passed
@sfmskywalker sfmskywalker deleted the copilot/add-onboarding-deployment-docs branch December 2, 2025 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants