Sample custom element and Azure Function code that uses the Kontent Management API to deep clone a content item. The deep clone covers all recursively referenced content items and their values.
The code in this repository is configured for Azure Functions, however it can be lifted to any web application running ASP.NET Core 3.1.
- Deploy the Azure Function code in
Functions.sln
to an Azure Function. See the Function Settings section for additional configuration steps. - Deploy the custom element code in
Client/
to a secure public host.- See the Deploying section for a really quick option.
- Follow the instructions in the Kentico Kontent documentation to add the element to a content model.
- The
Hosted code URL
is where you deployed to in step 1. - The
Parameters {JSON}
is a JSON object containing optional defaults. See the JSON parameters section for details.
- The
The Azure Function code requires two settings: ProjectId
and ManagementApiKey
. You can either set them using Visual Studio or use the options here.
Netlify has made this easy. If you click the deploy button below, it will guide you through the process of deploying it to Netlify and leave you with a copy of the repository in your GitHub account as well.
backendEndpoint
is a string
defining the Azure Function URL appended with /clone
.
Example JSON parameters object:
{
"backendEndpoint": "https://sample-kontent-deep-clone.azurewebsites.net/clone"
}