Backend service for Kontent.ai Learn that fetches content from Kontent.ai.
Together with GitHub Reader, this service is responsible for maintaining Kontent.ai content items that represent code samples used in Kontent.ai Learn.
Samples Manager responds to changes in the stored code samples in Azure Blob Storage and then updates content items in Kontent.ai project accordingly.
- This project is a JavaScript Azure Durable Functions application.
- After the GitHub Reader saves changed code samples in the storage, Samples Manager updates content items in Kontent.ai project using Content Management API.
- This service is subscribed to a Blob Created event type which is fired when GitHub Sync stores code samples to the Azure Blob Storage.
- In order to handle many code samples at once, the service is written as an Azure Durable function that executes a sequence of functions in a specific order. Each of those functions will process only a specified amount of code samples.
- Node (+yarn) installed
- Visual Studio Code installed
- Subscriptions on Kontent.ai and MS Azure
- Open Visual Studio Code and install the prerequisites according to the following steps.
- Log in to Azure using the Azure Functions extension tab.
- Clone the project repository and open it in Visual Studio Code.
- Run
yarn install
in the terminal. - Set the required keys.
- Deploy to Azure using Azure Functions extension tab, or run locally by pressing
Ctrl + F5
in Visual Studio Code.
KC.ProjectId
- Kontent.ai project IDKC.ContentManagementApiKey
- Kontent.ai Management API keyKC.Step.CopywritingId
- Copywriting workflow step IDKC.Step.PublishedId
- Published workflow step IDKC.Step.ArchivedId
- Archived workflow step IDAzure.ConnectionString
- Connection string for the Azure Storage accountChunkSize
- Amount of code samples processed in a call of a single functionEventGrid.Notification.Key
- Key for notification eventGrid topicEventGrid.Notification.Endpoint
- Url for notification eventGrid topic
- Run
yarn run test
in the terminal.
Feel free to open a new issue where you describe your proposed changes, or even create a new pull request from your branch with proposed changes.
All the source codes are published under MIT license.