skip to Main Content

I am trying to use the AWS .NET Configuration Extension for Systems Manager Nuget package (Amazon.Extensions.Configuration.SystemsManager) to retrieve configurations stored in AWS Parameter Store.

I am using the following lines of code taken from the GitHub documentation:

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
        WebHost.CreateDefaultBuilder(args)
            .ConfigureAppConfiguration(builder =>
            {
                builder.AddAppConfig("AppConfigApplicationId", "AppConfigEnvironmentId", "AppConfigConfigurationProfileId", TimeSpan.FromSeconds(20));
            })
            .UseStartup<Startup>();

After running the code I am getting a NotImplementedException being thrown with the message:

Not implemented AppConfig type: application/octet-stream

2

Answers


  1. You’re calling the wrong method on the builder.

    For obtaining values from AWS SSM’s Parameter Store, you should be using builder.AddSystemsManager:

    public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
      WebHost.CreateDefaultBuilder(args)
          .ConfigureAppConfiguration(builder =>
          {
              builder.AddSystemsManager("/my-application/");
          })
          .UseStartup<Startup>();
    

    Using builder.AddAppConfig is for obtaining values from AWS SSM’s AppConfig, not Parameter Store.

    Login or Signup to reply.
  2. I found then if I stored data that was more complex than a single word in Parameter store it would give me the NotImplementedException: Not implemented AppConfig type: application/octet-stream. In that case you would need to use .AddSystemsManager() instead.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search