Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetching Keys from Azure App Config using metadata.label not returning appropriate response. #570

Closed
dbauswel opened this issue Feb 8, 2024 · 4 comments · Fixed by #571
Assignees
Labels
bug Something isn't working

Comments

@dbauswel
Copy link

dbauswel commented Feb 8, 2024

Fetching Keys from Azure App Configuration using metadata.label field does not work. Currently receiving a 404 response.
code snippet attached.

const config = await client.configuration.get(
            'azureappconfig',
            [key1],
            {
                metadata: {
                    label: yourEnv
                }
            }
        )

Note that making a direct call works.
/v1.0/configuration/azureappconfig?key=key1&metadata.label=yourEnv

@shubham1172
Copy link
Member

Hi @dbauswel, the HTTP DaprClient does not support configuration so I guess you meant the gRPC DaprClient is throwing a not-found error? Are you able to make a direct gRPC request and get this data?

@tlund101
Copy link
Contributor

tlund101 commented Feb 9, 2024

Hi @dbauswel, the HTTP DaprClient does not support configuration so I guess you meant the gRPC DaprClient is throwing a not-found error? Are you able to make a direct gRPC request and get this data?

@shubham1172 I'm familiar with the issue, and this is correct. Both GetConfiguration and GetConfigurationAlpha1 from the proto file correctly return a key with the matching metadata label via gRPC request. Trying to use the gRPC DaprClient seems to ignore the metadata and returns a matching key without a label (if there is one, otherwise it logs a 404 error).

Passing an empty array to fetch all keys returns them all, and those that have labels show them in the metadata field that is returned.

@shubham1172
Copy link
Member

Thanks for the insight @tlund101, it looks like it's the way the metadata is being passed.

Non-working scenario

client.getConfiguration(msg, metadata, (err, res: GetConfigurationResponse) => {

Working scenario

addMetadataToMap(msgService.getMetadataMap(), options.metadata);

We need to change it. Please let me know if any of you want to create a PR, else I will create one.

@shubham1172 shubham1172 added the bug Something isn't working label Feb 9, 2024
@tlund101
Copy link
Contributor

tlund101 commented Feb 9, 2024

Looks pretty straightforward, I'll take a look at it and test it on our end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants