Giter Site home page Giter Site logo

tnc1997 / azure-app-configuration-emulator Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 3.0 202 KB

Please note that Emulator for Azure App Configuration is unofficial and not endorsed by Microsoft.

License: MIT License

Dockerfile 0.30% C# 72.02% HTML 25.31% CSS 0.68% JavaScript 0.57% Inno Setup 1.11%
azure-app-configuration emulator

azure-app-configuration-emulator's People

Contributors

dependabot[bot] avatar paulirwin avatar tnc1997 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

azure-app-configuration-emulator's Issues

Add entity tag header and last modified header to key value result

Describe the bug
The entity tag header and last modified header are missing from the KeyValueResult.

Current behavior
Steps to reproduce the behavior:

  1. Send a request to get a configuration setting.
  2. Observe the missing headers in the response.

Expected behavior
The KeyValueResult should include the entity tag header and the last modified header.

Add creating a feature flag via the UI

Is your feature request related to a problem? Please describe.
It is currently not possible to create a feature flag via the UI.

Describe the solution you'd like
I would like to be able to create a feature flag.

Describe alternatives you've considered
I am able to manually create a feature flag via the API.

Distinct configuration setting keys and labels

Describe the bug
Duplicate keys and labels are repeated in the response items array with regards to #4 and #5.

Current behavior

  1. Create multiple configuration settings with the same key but different labels.
  2. List configuration setting keys.
  3. Observe the duplicate keys in the response items array.

Expected behavior
Only distinct keys and labels are returned in the response items array.

Add support for entity tags and the associated headers

Is your feature request related to a problem? Please describe.
As a user I would like to execute relevant actions conditionally using entity tags and the associated headers.

Describe the solution you'd like
The ConfigurationSetting class should contain an ETag property.
The relevant actions should accept the If-Match and If-None-Match headers.

Additional context
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-key-value#get-conditionally
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-key-value#set-key-conditionally
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-key-value#delete-key-conditionally

The entity tag property is not being encoded correctly

Describe the bug
The entity tag property is not being encoded correctly when a configuration setting is added or updated.

Current behavior
Steps to reproduce the behavior:

  1. Send a request to add or update a configuration setting.
  2. Observe the incorrectly encoded value for the entity tag.

Expected behavior
The entity tag property should be encoded as a Base64 string instead of a UTF-8 string.

Front-end UI

Is your feature request related to a problem? Please describe.
This is a proposal for adding a front-end UI to this project, to more easily manage configuration settings and feature flags with the local emulator.

Describe the solution you'd like
My current use case involves configuration settings being set in the Azure Portal UI in Configuration Explorer (or the Feature Flags view), including frequently changing their values to test them, so it is a bit burdensome to have to set these manually in the emulator via Postman and such. I'd love to have a front-end UI (probably accessible from the root URL of the app) so that I can easily toggle feature flags and configuration settings.

I think this could be done entirely in JS, with no server-side .NET code needed. It could have a credential/secret input that builds the authentication headers entirely client-side. This also could enable a future enhancement of specifying a target URL, to even use this against a live Azure App Config instance, to verify that it works properly, or even enable other potential use cases around having a local, debuggable remote configuration UI for Azure App Config, or enable sync from Azure App Config to your local emulator.

At a minimum, this should have all the basic Configuration Explorer functionality from the portal, such as creating/updating/deleting config settings with labels, as well as the Feature Manager functionality of creating/editing/deleting and toggling feature flags with labels. My use case also needs administration of feature flag filters (like the targeting filter), but I accept that that could be a separate future enhancement.

Describe alternatives you've considered
Postman, building an internal custom admin UI for my use case

Additional context
I have limited bandwidth at the moment but I could help get this initiative started, if that sounds good to @tnc1997. I would probably default to using the latest Angular/Material on this just because I know it like the back of my hand, but if someone else has different opinions on how it should be done, I can help contribute once they get the architecture started.

Integrate with OpenTelemetry

Is your feature request related to a problem? Please describe.
I would like to be able to view metrics and traces using OpenTelemetry.

Describe the solution you'd like
I would like Emulator for Azure App Configuration to be integrated with OpenTelemetry.

Describe alternatives you've considered
I have not considered any alternatives to OpenTelemetry.

Add a configuration setting revision entity to the database

Is your feature request related to a problem? Please describe.
As a user I would like historical configuration settings to be stored in the database.

Describe the solution you'd like
The ApplicationDbContext should contain a ConfigurationSettingRevisions property.
The table should be populated by the methods in the ConfigurationSettingRepository.

Add unit tests to cover logic applied to handler inputs

Is your feature request related to a problem? Please describe.
The logic that is applied to handler inputs is currently not covered by unit tests although it should be.

Describe the solution you'd like
I would like to see unit tests added that cover the different possible combinations of handler inputs.

Add configuration setting editing via the UI

Is your feature request related to a problem? Please describe.
It is currently not possible to edit a configuration setting via the UI.

Describe the solution you'd like
I would like to be able to edit a configuration setting.

Describe alternatives you've considered
I am able to "edit" a configuration setting by deleting it and then recreating it.

Distribute a Windows installer with each release

Is your feature request related to a problem? Please describe.
As a developer I would like to install Emulator for Azure App Configuration on my Windows device.

Describe the solution you'd like
I would like a Windows installer to be distributed with each release.

Describe alternatives you've considered
Emulator for Azure App Configuration can be pulled from Docker Hub and then run in a container.

Add importing from Azure App Configuration via the UI

Is your feature request related to a problem? Please describe.
It is currently not possible to import configuration settings from Azure App Configuration via the UI.

Describe the solution you'd like
I would like to be able to import configuration settings from Azure App Configuration.

Describe alternatives you've considered
I am able to export configuration settings to a JSON file and then import configuration settings from the JSON file.

Add support for authentication using HMAC

Is your feature request related to a problem? Please describe.
The emulator does not require authentication which does not align with Azure App Configuration.

Describe the solution you'd like
The emulator requires authentication using the HMAC authentication scheme as documented here.

SQLite DB parameter factory incorrectly serializing tags as dictionary to string

Describe the bug
The SqliteDbParameterFactory is incorrectly serializing configuration setting tags as dictionary ToString e.g.

System.Collections.Generic.Dictionary`2[System.String,System.String]

Current behavior
Steps to reproduce the behavior:

  1. Add a configuration setting with some tags.
  2. Observe the tags incorrectly serialized in the database.

Expected behavior
The configuration setting tags should be serialized as a JSON object.

Additional context


IDictionary<string, object?> d => new SqliteParameter(name, SqliteType.Text) { Value = JsonSerializer.Serialize(d) },

Add enabling/disabling a feature flag via the UI

Is your feature request related to a problem? Please describe.
It is currently not possible to enable nor disable a feature flag via the UI.

Describe the solution you'd like
I would like to be able to enable and disable a feature flag.

Describe alternatives you've considered
I am able to manually enable and disable a feature flag via the API.

Add importing from a JSON file via the UI

Is your feature request related to a problem? Please describe.
It is currently not possible to import configuration settings from a JSON file via the UI.

Describe the solution you'd like
I would like to be able to import configuration settings from a JSON file.

Describe alternatives you've considered
I am able to manually "import" configuration settings one at a time via the API.

Keys with slashes (inc. feature flags) return 404

Describe the bug
Attempted to recreate some HTTP calls that work with the real Azure App Config API, like PUT'ing a feature flag, and it fails with a 404 if the key in the URL contains a slash. Feature flags have a key prefix of .appconfig.featureflag/ so the URL is like /kv/.appconfig.featureflag/MyFlagName

Note that the solution is not to URL encode the slash, as that does not match the behavior of Azure App Config.

Current behavior
Steps to reproduce the behavior:

  1. Use Postman to PUT /kv/.appconfig.featureflag/MyFlagName with a valid feature flag body (see below)
  2. 404 is returned instead of expected 200 OK

Example feature flag body:

{
    "key": ".appconfig.featureflag/MyFlagName",
    "label": null,
    "content_type": "application/vnd.microsoft.appconfig.ff+json;charset=utf-8",
    "value": "{\"id\":\"MyFlagName\",\"description\":\"\",\"enabled\":true,\"conditions\":{\"client_filters\":[{\"name\":\"Microsoft.Targeting\",\"parameters\":{\"Audience\":{\"Users\":[],\"Groups\":[],\"DefaultRolloutPercentage\":0}}}]}}",
    "tags": {}
}

Expected behavior
200 OK result

Screenshots
N/A

Additional context
I will attempt to fix this problem and submit a PR.

Add support configuration auto-import on startup

It would be very convenient to be able to import configuration from a file on startup to facilitate testing. This would avoid the need to write custom code to seed the emulator with configuration prior to running my test cases.

Add support for Microsoft Entra ID authentication

My organization has many applications which are configured/restricted to use only Azure Entra (Specifically client secret) authentication when accessing any Azure service. We strive to test our applications in as similar an environment as productions as is possible without creating test-only code paths. Thus, it would be beneficial to authenticate with your app configuration emulator either using Entra auth or to be able to disable authentication requirements entirely.

Publish an official container image

My primary use case for you project is automated testing where my test environment is managed via Testcontainers. Unfortunately, this tool does not support (as far as I can tell) using a git URL for the container build context as your do in the docker-compose snippet of your README.md. For my use case, it would be valuable to reference an image in a OCI-complaint registry (such as github container registry).

If you endorse this effort, I would be happy to make create a PR which builds and publishes an image via github actions.

Integrate with Azure Event Grid

Is your feature request related to a problem? Please describe.
I would like the emulator to publish events when configuration settings are deleted or modified.

Describe the solution you'd like
I would like Emulator for Azure App Configuration to be integrated with Azure Event Grid.

Describe alternatives you've considered
I have not considered any alternatives to Azure Event Grid.

Consider merging libraries to reduce complexity

I see that the project is made up of quite a few libraries which all get referenced by the main application.
Many of these libraries:

  • are tiny - consisting of only 2 code files
  • do not encapsulate functionality reusable outside of the main application

You might consider collapsing some of these libraries into one or even into the main application. This would serve to:

  • condense the code in a more shallow and narrow directory structure possibly improving navigability and discoverability
  • reduce the number of inter-project dependencies to achieve a simpler build process
  • reduce startup time since fewer libraries would need loading and linking (though this is likely insignificant).

On that note, nice work on a great project! ๐Ÿ˜‰ Cheers!

Create a Testcontainers module to support easy testing.

It would be valuable to support a Testcontainers module to quickly enable integration tests dependant on azure-app-configuration-emulator.

Testcontainers is a popular library use for defining and managing complex container environments for integration testing. This library introduces the concept of a module as an extension library which enables complex automatic configuration and best practices when integrating specific 3rd-party applications.

Although the Testcontainers project provides modules for many commonly used applications, other projects (such as WireMock.Net) provide their own Testcontainers modules.

The features I would like in this module:

  • Automatic provisioning and deployment of a self-signed certificate deployed and configured into the azure-app-configuration-emulator container.
  • Helper functions for computing an App Configuration endpoint Uri for use both from the host and within the containerized environment (using a host alias).
  • Helper function for creating an ConfigurationClient for use within the test environment to setup configuration during a test.

Add support for getting historical configuration settings

Is your feature request related to a problem? Please describe.
As a user I would like to get historical configuration setting data.

Describe the solution you'd like
The relevant actions should accept the Accept-Datetime header.

Additional context
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-keys#time-based-access
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-key-value#time-based-access
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-labels#time-based-access

Add support for HTTPS using an SSL certificate and an SSL certificate key

Is your feature request related to a problem? Please describe.
The emulator currently uses HTTP which is incompatible with Azure App Configuration which requires HTTPS.

Additional context
The implementation should include native support for running the emulator in a Docker container using HTTPS.

Normalize null labels from the list labels endpoint

Describe the bug
Labels returned from the list labels endpoint do not have nulls normalized.

Current behavior

  1. Create a configuration setting with a null label.
  2. List configuration setting labels.
  3. Observe the unnormalized label in the response.

Expected behavior
Labels returned from the list labels endpoint should either be a value of type string or null.

The last modified and entity tag properties are not being updated

Describe the bug
The last modified and entity tag properties are not being updated when updating a configuration setting.

Current behavior
Steps to reproduce the behavior:

  1. Add a configuration setting.
  2. Make a note of the entity tag value.
  3. Update the added configuration setting.

Expected behavior
The last modified and entity tag properties should be updated.

Serialize configuration setting tags as an empty object if null

Describe the bug
When the configuration setting tags property is null it is incorrectly serialized as null instead of an empty object.

Current behavior
Steps to reproduce the behavior:

  1. Add a configuration setting with a null tags property.
  2. Get the configuration setting using the Azure App Configuration SDK for .NET.
  3. Observe the invalid operation exception as per the screenshot.

Expected behavior
When the configuration setting tags property is null it should be serialized as an empty object.

Screenshots
image

Additional context
Azure.Data.AppConfigurationConfigurationServiceSerializer.ReadPropertyValue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.