A super simple cache management for feature flags in Azures App Configuration Services.
Azures App Configuration Service comes with various limitations:
- limited number of requests per hour
- some SDKs can only fetch one setting at a time
On medium scale front-end applications these limitations make this service impossible to use. In order to make Azures solution somehow usable you can make use of this proxy. It caches your data for a defined period of time, allowing you to overcome the limitations of Azures solution.
- 🚀 Getting Started
- ⚙️ Build and Deploy
⁉️ How to use- 📝 License
To get started with using this proxy service you will need two things:
- An Azure Web App Service - you will find the web.config file for the Windows stack in this repository
- An App Configuration Service
- An Azure Application Insights Service
The Web App Service is where you will host and deploy this proxy. You will also throw in some configuration in order to expose the mandatory node environment variables to the application.
From the latter two you will use the Application Insights Connection String for initializing monitoring on your application and the READ-ONLY connection string from your App Configuration Service. Consult the image below:
Building the application is as simple as running one command:
npm run build
You can either deploy the contents of /dist
folder in your own custom way, or you can refer to the .azure folder for a demo pipeline that you can run on Azure.
After you deploy this service to a web application, you will have 3 endpoints exposed:
/
/flush-cache
/health-check
The main endpoint supports passing a query parmeter with the value containing your comma separated feature flags.
/**
* GET /?feature=first,second,third
*
* Example result
*/
{
first: true,
second: true,
third: false
}
The flush cache endpoint provides you with full control on syncing the web service with the app configuration service.
/**
* GET /flush-cache
*
* Positive result
*/
{
code: "cache_flushed",
message: "Cache has been flushed!"
}
The health check endpoint allows you to integrate your service with various sanity checks within your infrastructure - this is, of course, optional. In case of a different response than the one below, you are most likely experiencing issues with the service.
/**
* GET /health-check
*
* Positive result
*/
{
code: "healthy",
message: "Everything works correctly!"
}