Set up the project for local development (using ASP.NET Core Renderer)
The decoupled ASP.NET Core Renderer in Sitefinity Cloud enables you to take advantage of a three-tier application architecture and build your frontend presentation layer using ASP.NET Core.
Set up the ASP.NET Core Renderer project code locally
The project’s code files can be accessed from the Repos section on the Management Portal. You can clone the repository for local development.
To set up the Renderer project on your local development environment, follow these steps:
- Log in to your Sitefinity Cloud Management Portal.
- Navigate to Repos » Files.
- From the branches dropdown, select the project branch that you want to setup locally.
For example, select main
.
- To clone the project Git repository on your local machine, click the Clone button, located in the upper right corner of the screen.
- You can clone the repository using the command line or by selecting an IDE you want to clone to. For example, to clone the project in Visual Studio, from the IDE dropdown, select Clone in Visual Studio. Then specify your Microsoft Entra ID (formerly, Azure AD) credentials, when prompted by the Visual Studio.
Configure the Renderer application
After you have cloned the repository locally, you must configure the ASP.NET Core Renderer application to connect to Sitefinity CMS. In Sitefinity Cloud, you can connect your local ASP.NET Core Renderer application only to a non-Production environment, which is Staging in a default setup.
In Sitefinity Cloud PaaS setup where the Developer Extensions toggle is enabled, you can configure the Renderer application to work with your local setup of the Sitefinity CMS application - in case you need to simultaneously develop on both applications.
When you connect your local ASP.NET Core Renderer application to a Sitefinity CMS application instance hosted in the cloud, you must configure the LocalValidationKey
property of the ASP.NET Core Renderer application. Your local Renderer application will send the LocalValidationKey
with each request. When the HTTP request reaches the cloud-hosted ASP.NET Core Renderer application, it will compare the incoming LocalValidationKey
with its own RemoteValidationKey
. If they match, then the setup will be successful, and you will be able to develop locally against the cloud-hosted version of application.
To configure the LocalValidationKey
property of the ASP.NET Core Renderer application, perform the following:
- Navigate to your dedicated Key Vault instance in the Azure portal.
For more information, see Azure Key Vault.
- On the Key Vault left-hand sidebar, select Objects and then select Secrets.
- Select LocalValidationKey and from the listed versions, select the current version of the value.
- In the dialog that opens, copy the value specified in Secret value.
- On your local Renderer, edit the
appsettings.json
file and under “Sitefinity”
section, add the validation key and edit the URL in the following way:
- Save and close the file.
- Build the project.
Run the Renderer application locally
To run the ASP.NET Core Renderer application on the local environment, navigate to: https://localhost:5001/Sitefinity
or http://localhost:5000/Sitefinity