tnc1997 / azure-app-configuration-emulator Goto Github PK
View Code? Open in Web Editor NEWPlease note that Emulator for Azure App Configuration is unofficial and not endorsed by Microsoft.
License: MIT License
Please note that Emulator for Azure App Configuration is unofficial and not endorsed by Microsoft.
License: MIT License
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:
PUT /kv/.appconfig.featureflag/MyFlagName
with a valid feature flag body (see below)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.
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
.
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.
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
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.
Describe the bug
Labels returned from the list labels endpoint do not have nulls normalized.
Current behavior
Expected behavior
Labels returned from the list labels endpoint should either be a value of type string or null.
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:
Expected behavior
The entity tag property should be encoded as a Base64 string instead of a UTF-8 string.
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:
Expected behavior
The last modified and entity tag properties should be updated.
Describe the bug
Duplicate keys and labels are repeated in the response items
array with regards to #4 and #5.
Current behavior
items
array.Expected behavior
Only distinct keys and labels are returned in the response items
array.
Is your feature request related to a problem? Please describe.
As a user I would like to unlock a configuration setting.
Additional context
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-locks#unlock-key-value
Is your feature request related to a problem? Please describe.
As a user I would like to create and/or update configuration settings.
Additional context
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-key-value#set-key
Is your feature request related to a problem? Please describe.
As a developer I would like to store configuration settings in a SQLite database using Entity Framework Core.
Is your feature request related to a problem? Please describe.
As a user I would like to get a configuration setting.
Additional context
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-key-value#get-key-value
Is your feature request related to a problem? Please describe.
As a user I would like to list configuration setting labels.
Additional context
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-labels#list-labels
Describe the bug
The entity tag header and last modified header are missing from the KeyValueResult
.
Current behavior
Steps to reproduce the behavior:
Expected behavior
The KeyValueResult
should include the entity tag header and the last modified header.
Is your feature request related to a problem? Please describe.
As a user I would like to lock a configuration setting.
Additional context
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-locks#lock-key-value
Is your feature request related to a problem? Please describe.
As a user I would like to delete a configuration setting.
Additional context
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-key-value#delete
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.
Is your feature request related to a problem? Please describe.
As a user I would like to list configuration settings.
Additional context
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-key-value#list-key-values
Is your feature request related to a problem? Please describe.
As a user I would like to list configuration setting keys.
Additional context
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-keys#list-keys
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.