Main goal - have possibility to call it native way from DevOps pipeline
Example of use - HUGO site on Azure and we should publish json file to Algolia with TechDoc theme.
For local development or testing we should use file
local.settings.json - where inside section Values
we add 4 parameters
"AlgoliaAppId":"Application Id from Algolia site", "AlgoliaAdminKey": "Admin key from algolia site", "AlgoliaIndexName": "Index name from algolia site", "JSON_URL":"https://URL/algolia.json"
For usage in Azure - we should add this parameters to Application settings
function updateIndexFromURL - update index from url function sendNewJsonToAlgolia - update index from multi part form data request with file You can setup Hugo site hosted on Azure. You can setup Azure DevOps pipeline for Hugo static site to support CI-CD foe static web site. You can use additional step to call algolia index update. In general, this function can be used from Power Shell - Invoke-WebRequest, or from Postman (example below).
clone this repository, publish azure function from VS code
clone - git clone https://github.com/vglu/AzureFunctionAlgoliaUpdateIndexFromJson.git
Azure extension for VS code https://code.visualstudio.com/docs/azure/extensions
Too many variants how to use CI/CD with Azure function. I have created Azure DevOps project based on GitHub repository and setup Build and Release pipelines from Azure DevOps
Here is example how to use it from Postman