Umbraco 17 Best Practices: Project Structure, Development Guidelines and Common Pitfalls
Umbraco 17 brings together the long-term stability of an LTS release and the capabilities of .NET 10, providing a strong foundation for building modern enterprise websites and digital experiences.
However, choosing the right CMS version is only the beginning. The way an Umbraco project is structured, developed, deployed and maintained has a significant impact on its long-term stability, scalability and maintainability.
Many issues encountered in enterprise Umbraco projects are not limitations of the CMS itself. They often arise from inconsistent project conventions, unnecessary dependencies, configuration mistakes and infrastructure decisions that were never designed for production environments.
Whether you're starting a new Umbraco 17 implementation, reviewing an existing solution or preparing a project for enterprise deployment, establishing the right engineering practices early can prevent significant problems later.
In this guide, we explore 13 important areas of Umbraco 17 development, including project architecture, ModelsBuilder, request handling, media storage, background processing, authentication and multi-node deployments.
Key Takeaways
- Establish a clean project architecture: Separate application responsibilities and keep Umbraco-specific dependencies away from core business logic.
- Maintain consistent package versions: Use Central Package Management to avoid dependency conflicts across projects.
- Manage ModelsBuilder and database upgrades carefully: Establish predictable development and production workflows.
- Design infrastructure for scale: Shared media storage, distributed caching and persistent Data Protection keys are important for multi-node environments.
- Avoid unnecessary complexity: Use appropriate APIs, background jobs and deployment patterns rather than introducing workarounds.
- Build quality into the project template: Automated tests, health checks, configuration validation and consistent engineering standards should be part of the foundation.
Understand Your Umbraco Architecture Before Development
One of the first mistakes teams make when starting an Umbraco project is assuming that every modern CMS implementation needs to be headless.
In practice, many Umbraco 17 projects are traditional server-rendered websites built using Razor views, with a few JSON endpoints supporting specific application requirements.
Some projects use hybrid architectures, combining server-rendered pages with separate frontend applications or external services.
Before selecting an architecture, establish how the application will actually be used.
Consider the following questions:
- Is there a separate frontend application consuming content from Umbraco?
- Are webhooks, content revalidation or preview workflows required?
- Is the Umbraco Delivery API enabled and actively consumed?
- Where will the application, database and media files be hosted?
- What deployment pipeline and testing strategy will be used?
These questions help determine whether a traditional server-rendered architecture, a hybrid implementation or a headless approach is appropriate.
The important principle: Choose your architecture based on actual application requirements, not because a particular approach is currently popular.
Establish a Maintainable Project Structure
A well-organized solution makes an Umbraco application easier to develop, test, upgrade and maintain.
For enterprise projects, separating responsibilities into dedicated projects can help establish clear boundaries between domain models, business logic and the web application.
A typical solution structure might look like this:
MyProject.Common | MyProject.Core | MyProject.Web |
|---|---|---|
Generated ModelsBuilder models | Services | Program.cs |
DTOs | Repositories | Controllers |
Shared models and helpers | Notification handlers | Razor Views |
Middleware | wwwroot | |
Business logic | appsettings |

The objective is not simply to divide code into different folders or projects. It is to establish clear dependency boundaries.
Keep Umbraco dependencies at the appropriate layer
A common architectural problem occurs when business logic directly depends on Umbraco-specific types and services.
For example, if core business services depend heavily on IPublishedContent or IContentService, changes to Umbraco APIs can affect multiple parts of the application.
This makes major upgrades more complicated than necessary.
A better approach is to use interfaces, services and repositories to separate business logic from CMS-specific implementation details.
Keep Umbraco dependencies closer to the application and infrastructure layers wherever practical.
Avoid hidden dependencies
Another common issue is relying on static or ambient application state.
Examples include:
- Service locators implemented through AsyncLocal.
- Mutable static properties such as Languages.Current.
- Custom base-controller factories that hide dependencies.
These patterns can make dependencies difficult to understand and complicate unit testing.
Prefer constructor injection and standard dependency injection practices. Use ILogger
Keep package versions consistent
An Umbraco solution may contain several projects, and each project can introduce its own package dependencies.
If one project references Umbraco 17.0.0 while another references 17.0.2, inconsistent package versions can introduce compatibility problems.
Central Package Management through Directory.Packages.props provides a more controlled approach by maintaining package versions in one place.
It also makes future upgrades easier to manage.
Manage ModelsBuilder and Database Upgrades Properly
ModelsBuilder is an important part of strongly typed Umbraco development. However, its configuration and deployment workflow need to be handled carefully.
For development environments, SourceCodeManual or SourceCodeAuto can be used to generate models from Umbraco document types.
A typical workflow is:
- Create or update document types in the Umbraco backoffice.
- Generate the corresponding ModelsBuilder models.
- Build the application.
- Commit the generated models to source control.
- Deploy the compiled application assemblies.
This approach provides predictable model generation and allows the generated code to be reviewed and version-controlled.

Production configuration
Production environments should use compiled models rather than relying on development-time model generation.
The source implementation specifies ModelsMode as Nothing for production.
Development-only model generation approaches, such as InMemoryAuto and runtime compilation, should not be carried into production.
Database upgrade management
Database upgrades require additional attention when deploying a new Umbraco version.
Umbraco supports unattended database upgrades through configuration:
{
"Umbraco": {
"CMS": {
"Unattended": {
"UpgradeUnattended": true
}
}
}
}
When unattended upgrades are enabled, the first application node to start after a new version deployment performs the database upgrade.
In a multi-node environment, this introduces an important deployment consideration.
Do not allow several new-version application nodes to start simultaneously against an old database without a controlled upgrade strategy.
The database upgrade process should be planned as part of the release procedure, with the appropriate configuration and deployment sequence.
Follow Consistent Request Handling Patterns
Request handling becomes particularly important when an Umbraco website supports multiple languages, external integrations, forms and custom APIs.
Establishing consistent patterns early makes the application easier to maintain and reduces unexpected behaviour.
Culture routing and multilingual websites
Multilingual websites need a consistent approach to resolving the requested content culture.
Depending on the implementation, culture information may be obtained from:
- URL prefixes.
- HTTP headers.
- Query-string parameters.
For example, a website might use URLs structured as:
/en/products/example/
/ar/products/example/
The culture resolution process should be centralized in middleware rather than implemented independently across controllers and services.
Test language switching, redirects and URL handling carefully, particularly when supporting right-to-left languages such as Arabic.
Choose the right API response structure
Umbraco applications often expose custom JSON endpoints.
There are two common approaches.
HTML-based responses
An endpoint can return JSON containing an HTML string generated from a Razor partial.
This approach can be convenient when a frontend needs server-rendered HTML fragments.
However, it couples the consuming application to the server-side markup.
If this approach is used, consider short-lived caching, request-based cache keys and limits on response body size.
DTO-based responses
A DTO (Data Transfer Object) endpoint returns structured data rather than pre-rendered HTML.
This provides a cleaner separation between the backend and consuming application.
It is generally a better choice when building new APIs for separate frontend clients or external integrations.
Forms and request protection
Forms should include appropriate antiforgery protection and CAPTCHA validation where necessary.
CAPTCHA credentials should be stored in configuration or a secure settings system rather than hardcoded into application code.
Server-side validation is essential, and rate limiting should be considered to reduce automated abuse.
Cross-Origin Resource Sharing (CORS) policies should also be explicitly defined through configuration, such as an AllowedOrigins setting.
Finally, Content Security Policy (CSP) should be implemented according to the application's security requirements. A per-request nonce generated through middleware can support a more controlled script policy.
Understand When to Use the Umbraco Delivery API
The Umbraco Delivery API allows external applications to retrieve published content in a structured JSON format.
It is particularly useful when Umbraco acts as the content management backend for a separate frontend application.
However, not every Umbraco website needs the Delivery API.
For traditional server-rendered Razor websites, enabling an API that no application actually consumes introduces unnecessary configuration and maintenance responsibilities.
In Umbraco 17, registering the Delivery API does not by itself mean the API is enabled. Its configuration must also be considered.
Common implementation mistakes include:
- Registering the Delivery API without configuring it.
- Exposing an endpoint that is not actually used.
- Leaving an inactive API route accessible.
- Assuming that an API is enabled simply because its dependencies are registered.
If the application requires the Delivery API, configure and test it properly.
If it is not needed, avoid registering unnecessary API functionality or exposing unused routes.
Plan Media Storage, CDN and Upload Limits
Media management becomes increasingly important as Umbraco websites grow.
Enterprise websites may contain thousands of images, documents and other digital assets. Storing and serving these files efficiently is essential for performance and scalability.
Choose an appropriate media storage strategy
For Azure-based deployments, Umbraco provides an Azure Blob Storage integration through its storage provider packages.
For AWS-based deployments, S3 can be used through an appropriate community provider or custom integration.
The choice should consider the existing infrastructure, storage requirements and application architecture.
A CDN or edge delivery service should also be considered for websites serving large volumes of media to geographically distributed audiences.
Without an appropriate media URL and delivery configuration, media requests may be routed through the application itself, increasing application workload.
Use cloud-native identity
Avoid relying on static storage access keys wherever possible.
Use managed identity, workload identity or the relevant cloud provider's default credential mechanism to establish secure application access.
This reduces the need to distribute and maintain long-lived credentials.
Configure upload limits consistently
File upload limits are controlled by several layers of the application infrastructure.
For example, an upload may be restricted by:
- Kestrel's MaxRequestBodySize.
- Umbraco's Runtime:MaxRequestLength.
- IIS's maxAllowedContentLength.
- Application-level file validation.
The important thing is to understand how these limits interact.
If one layer permits a 30 MB upload while another restricts requests to 10 MB, the effective limit will be 10 MB.
This can cause unexpected problems when editors attempt to upload media through the Umbraco backoffice.
Define upload limits deliberately and align all relevant configuration layers.
Avoid local disk dependencies
Writing generated files directly to the application's local disk can create problems in multi-node environments.
For example, generating a CSS file under wwwroot whenever content is saved may work on a single server but fail when requests are distributed across multiple application instances.
It can also create issues with run-from-package deployments and deployment slots.
Use shared storage or generate the required assets during the deployment process instead.
Design Background Jobs and Server Roles Carefully
Background processing is often required for scheduled operations, synchronization tasks, content processing and other application activities.
However, background jobs need to be designed with the application's deployment architecture in mind.
One common mistake is creating custom background services that repeatedly execute raw SQL against Umbraco database tables to compensate for an underlying configuration problem.
For example, periodically modifying OpenIddict redirect URIs through SQL is a workaround rather than a sustainable implementation.
Review the underlying configuration first, including application URLs and forwarded-header settings.
Understand Umbraco background job execution
Umbraco provides IRecurringBackgroundJob and AddRecurringBackgroundJob
The ServerRoles configuration determines which server roles execute the job.
In a multi-node environment, a job configured to run on every application role may execute multiple times.
This can result in duplicate processing, repeated notifications or inconsistent application behaviour.
Restrict scheduled jobs to the appropriate server role unless the operation has been designed to be idempotent.
An idempotent operation can safely be executed more than once without producing unintended duplicate results.
Configure Backoffice Authentication Properly
Enterprise Umbraco implementations often require centralized authentication for content editors and administrators.
Microsoft Entra ID and other OpenID Connect providers can be used to integrate external authentication with the Umbraco backoffice.
However, authentication and user provisioning are two different considerations.
In the implementation described here, the external user must already exist in Umbraco, and the identity is matched using the email address.
If automatic account creation is required, the appropriate external sign-in auto-linking configuration must also be implemented.
Additional controls may include:
- Approved external identity providers.
- Backoffice IP allow-listing.
- Centralized user provisioning.
- Appropriate role and permission assignment.
Umbraco 17 also uses its newer backoffice extension architecture.
For custom backoffice functionality, use the supported extension mechanisms, including Tiptap toolbar extensions, Lit-based property editor interfaces and package configuration through umbraco-package.json.
Prepare Your Application for Multi-Node Deployments
As enterprise websites grow, running multiple application instances can improve availability and support increased traffic.
Umbraco 17 also introduces support for load balancing the backoffice, extending multi-server capabilities to content editing and administration workflows.
However, running multiple nodes requires more than simply deploying the same application to several servers.
Several shared infrastructure and synchronization considerations must be addressed.
Shared media storage
All application nodes must be able to access the same media files.
Azure Blob Storage or an appropriately configured S3 integration can provide shared storage.
Local-disk writes should be avoided for application data that needs to be available across nodes.
Distributed cache and MainDom
Umbraco's distributed cache and MainDom coordination need to be configured according to the deployment architecture.
The source implementation calls for the SQL-based MainDom lock through MainDomLock and the appropriate distributed cache registration.
Existing projects should also review legacy NuCache configuration and remove obsolete settings where applicable.
Persistent Data Protection keys
ASP.NET Core Data Protection keys should be persisted to shared storage.
If each application node maintains its own independent keys, cookies or protected links generated by one node may not be readable by another.
This can lead to unexpected authentication issues or broken signed links.
Load balancer health checks
Load balancers should use a dedicated health-check endpoint, such as:
/healthz
rather than assuming that the website homepage is always an appropriate health-check target.
This is particularly important when host filtering is enabled.
Scheduled jobs and sessions
Review the execution role of every scheduled background job to prevent duplicate processing.
If application state depends on server-side sessions, configure appropriate session handling and sticky sessions where required.
A multi-node environment should be designed around shared state and predictable request handling rather than assumptions that every request will reach the same server.

Manage Multiple Git Worktrees and Repository Variants
Development teams sometimes maintain multiple Git worktrees for the same repository.
For example, a team may have separate worktrees for:
- A production hardening branch.
- A minimal handover implementation.
- A broader code cleanup.
- A feature development branch.
Git worktrees allow several working directories to share a repository while maintaining separate branches.
However, they introduce a coordination risk.
A fix applied in one worktree may not exist in another. If branches are not properly integrated, teams can unintentionally maintain inconsistent versions of the same application.
Useful commands for reviewing worktrees and branches include:
git worktree list
git branch -vv
git log --oneline
Establish a clear integration sequence, merge the required changes and remove stale worktrees and branches once they are no longer needed.
This keeps the development environment organized and reduces the risk of missing important fixes.
What Should a Production-Ready Umbraco Reference Implementation Include?
One of the most effective ways to prevent recurring engineering problems is to establish a reference implementation or project template.
Instead of solving the same architectural and configuration problems in every new project, teams can start with a proven foundation.
A well-prepared Umbraco reference implementation should include the following.
Architecture and code organization
- Interface-based services and repositories.
- Constructor-based dependency injection.
- An Entity Framework Core context for custom application tables where required.
- Central Package Management.
- Consistent coding conventions through .editorconfig.
Automated testing
- Controller tests.
- Service and repository tests.
- Notification handler tests.
- Middleware tests.
- Security header tests.
- Application startup or boot tests.
The reference implementation should also include a boot test that starts the real Program.cs against an appropriate test database environment with secure test configuration.
Operational readiness
- Health-check endpoints.
- Per-IP rate-limiting policies.
- Trusted-proxy configuration.
- Allowed-host validation.
- Secure secret management.
- Documented configuration requirements.
Secrets should be stored in an appropriate vault rather than committed to source control.
For Azure Key Vault configuration, secret names use a double-hyphen convention to represent configuration separators, while environment variables commonly use double underscores.
The required configuration keys should also be documented so that development, staging and production environments can be configured consistently.
Common Umbraco 17 Development and Configuration Issues
Even well-structured projects can develop problems when conventions are not followed consistently.
The following are some common issues worth checking during development and code reviews.
1. Inconsistent package versions
Different projects referencing different Umbraco package versions can create dependency conflicts. Central Package Management helps maintain consistency.
2. Configuration key mismatches
For example, application code may read:
AppSettings:UseSendGrid
while the actual configuration defines:
EmailSettings:UseSendGrid
The application may silently use an unexpected default or fail to activate the intended feature.
Compare configuration keys used in code against the available configuration files and use options validation during application startup.
3. Referenced but unused packages
A project may include packages for rate limiting, error tracking or other capabilities that are never actually configured.
Use commands such as dotnet list package and review whether each dependency is required and correctly integrated.
4. Incorrectly ignored uSync folders
If uSync is installed but its synchronization files are excluded by Git ignore rules, important configuration changes may not be committed or transferred between environments.
Review the .gitignore configuration and verify that the intended synchronization files are version-controlled.
Also check that UmbracoApplicationUrl is configured correctly rather than left as a placeholder.
5. Legacy project artifacts
Older Umbraco projects may contain unused folders and dependencies from previous versions.
Examples include obsolete Grid and MacroPartials folders or unnecessary Smidge references.
Remove legacy components that are no longer required.
6. Obsolete API usage
Review older APIs such as Children() and Parent() when upgrading projects.
Where APIs are deprecated or marked for removal, plan their replacement before moving to a future major version.
7. Incomplete project documentation
Unfilled README templates and outdated setup instructions make projects harder to maintain and hand over.
Keep installation, configuration, deployment and development instructions up to date.
8. Incorrect upload size assumptions
Do not assume that default Kestrel upload limits are suitable for every enterprise website.
Review the effective upload limits across the application and infrastructure layers, particularly for large media libraries and backoffice users.
Build Better Project Foundations from the Start
Most recurring Umbraco project problems are not caused by limitations in the CMS itself. They are often the result of inconsistent engineering conventions, incomplete project templates and infrastructure decisions that were never designed for production use.
Umbraco 17 provides a strong foundation through its .NET 10 LTS alignment, improved backoffice capabilities and support for modern enterprise architectures.
However, taking full advantage of these capabilities requires a disciplined engineering approach.
Establish clear project boundaries, maintain consistent dependencies, automate testing, manage configuration properly and design infrastructure for the way the application will actually operate.
Most importantly, turn these practices into a reusable reference implementation.
Rather than rebuilding the same engineering foundations for every new project, create a tested project template that incorporates the lessons learned from previous implementations.
At Technyx, we believe reliable enterprise CMS solutions start with strong engineering foundations. A well-structured Umbraco project is not just easier to develop; it is easier to maintain, upgrade, scale and operate over the long term.
Frequently Asked Questions
What is Umbraco 17? Umbraco 17 is a Long-Term Supported release of Umbraco CMS built on .NET 10 LTS. It introduces improvements including load balancing support for the backoffice and consistent UTC date handling.
Conclusion
Building a successful Umbraco solution requires more than selecting the right CMS version and implementing the required website functionality.
The engineering decisions made during development influence how easily the application can be maintained, upgraded, secured and scaled.
By following consistent project conventions, avoiding unnecessary workarounds and establishing a tested reference implementation, development teams can reduce recurring problems and build more reliable enterprise CMS solutions.
The strongest Umbraco implementations are not necessarily the most complicated ones. They are the ones built on clear architecture, predictable deployment processes and engineering practices that remain maintainable as the application evolves.





