2

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
Ermiya Eskandary
  • 15,323
  • 3
  • 31
  • 44
biki
  • 43
  • 1
  • 6

2 Answers2

0

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.

Ermiya Eskandary
  • 15,323
  • 3
  • 31
  • 44
-1

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.

Ben
  • 81
  • 2
  • 5