Skip to content

paulmorar/azure-app-configuration-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure App Configuration Service proxy

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.

Table of contents

Getting Started

To get started with using this proxy service you will need two things:

  1. An Azure Web App Service - you will find the web.config file for the Windows stack in this repository
  2. An App Configuration Service
  3. 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. image

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: image

Build and Deploy

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.

How to use

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!"
}

License

MIT

About

Proxy for caching values coming from an azure app configuration service.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published