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

[BUG] GetConfigurationSettings(SettingSelector) does not set the ContentType property #38524

Closed
ie-zero opened this issue Sep 6, 2023 · 3 comments
Assignees
Labels
App Configuration Azure.ApplicationModel.Configuration bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team

Comments

@ie-zero
Copy link

ie-zero commented Sep 6, 2023

Library name and version

Azure.Data.AppConfiguration 1.2.0

Describe the bug

The GetConfigurationSettings(SettingSelector) does not set the ContentType property i.e. it returns null when the Fields on the SettingSelector is set.

Example

var selector = new SettingSelector
{
      KeyFilter = "Operations:FuncApps:Usage:Settings:TestKeyVaultReference",
      LabelFilter = string.Empty,

      // SettingFields.ContentType will return null 
      //Fields = SettingFields.Key | SettingFields.Value | SettingFields.Label | SettingFields.ContentType

      // Works fine
      Fields = SettingFields.All
};

Expected behavior

The ContentType property is populated when the Fields = ... | SettingFields.ContentType

Actual behavior

The ContentType property is null

Reproduction Steps

  1. Create a App Configuration with URI abc.azconfig.io
  2. Create a KeyVault reference with key "Settings:TestKeyVaultReference" via Azure Portal to a KeyVault secret
  3. Grant access to the accessing use on both App configuration and KeyVault secret.
  4. Execute the following console app
using Azure.Data.AppConfiguration;
using Azure.Identity;

namespace TestSecretRetrieval;

public sealed  class Program
{
    public static void Main()
    {
        var client = new ConfigurationClient(new Uri("https://abc.azconfig.io"), new DefaultAzureCredential());

        var selector = new SettingSelector
        {
            KeyFilter = "Settings:TestKeyVaultReference",
            LabelFilter = string.Empty,

            // SettingFields.ContentType will return null 
            //Fields = SettingFields.Key | SettingFields.Value | SettingFields.Label | SettingFields.ContentType

            // Works fine
            Fields = SettingFields.All
        };
        var settings = client.GetConfigurationSettings(selector);

        // The 'Settings:TestKeyVaultReference' is a valid KeyVault reference and the account which is executed
        //  has access to retrieve the secret.

        foreach (var setting in settings)
        {
            // SettingFields.Key, SettingFields.Value and SettingFields.Label appear to work as expected.
            // The SettingFields.ContentType returns null unless SettingFields.All is specified.

            Console.WriteLine($"{SettingFields.ContentType} = '{setting.ContentType ?? "(null)"}'");
        }
    }
}

Environment

Project is running on .NET 6.0

.NET SDK (reflecting any global.json):
Version: 6.0.410
Commit: 28c7c894a3

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19044
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.410\

Host:
Version: 7.0.7
Architecture: x64
Commit: 5b20af47d9

.NET SDKs installed:
3.1.426 [C:\Program Files\dotnet\sdk]
6.0.402 [C:\Program Files\dotnet\sdk]
6.0.410 [C:\Program Files\dotnet\sdk]
7.0.100 [C:\Program Files\dotnet\sdk]
7.0.203 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Sep 6, 2023
@pallavit pallavit added the App Configuration Azure.ApplicationModel.Configuration label Sep 6, 2023
@github-actions github-actions bot removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Sep 6, 2023
@pallavit
Copy link
Contributor

pallavit commented Sep 6, 2023

Thank you for your feedback. Tagging and routing to the team member best able to assist.
/cc: @ShivangiReja , @jsquire

@jsquire jsquire added Client This issue points to a problem in the data-plane of the library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team labels Sep 6, 2023
@jsquire jsquire assigned kinelski and unassigned jsquire Sep 21, 2023
@kinelski kinelski added bug This issue requires a change to an existing behavior in the product in order to be resolved. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Sep 21, 2023
@kinelski
Copy link
Member

@ie-zero Thank you for reporting this bug. We were able to identify the cause and it has been fixed
(#38917). The fix will be available in our next beta release (1.3.0-beta.3) which is expected to be out in October.

Closing this since the issue has been addressed.

@ie-zero
Copy link
Author

ie-zero commented Nov 17, 2023

Thank you for addressing this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
App Configuration Azure.ApplicationModel.Configuration bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team
Projects
None yet
Development

No branches or pull requests

5 participants