Search code examples
aws-sdkaws-sdk-net

AWS .NET SDK on Linux


I am currently moving an ASP.NET application made by a third party from Windows to Linux. I read the documentation and nothing indicates this should be a problem, but sadly

var profile = new CredentialProfile(profileName, credentials) {
    Region = RegionEndpoint.EUWest1
};

var netSDKFile = new NetSDKCredentialsFile();
netSDKFile.RegisterProfile(profile);

throws the following exception

Unhandled Exception: Amazon.Runtime.AmazonClientException: The encrypted store is not available.  This may be due to use of a non-Windows operating system or Windows Nano Server, or the current user account may not have its profile loaded.
   at Amazon.Util.Internal.SettingsManager.EnsureAvailable()
   at Amazon.Runtime.CredentialManagement.NetSDKCredentialsFile..ctor()

Is the Amazon .NET SDK(or a part of it) not supported on Linux? If that is the case, is there a possible workaround?


Solution

  • For the most part there is very little that isn't supported on Linux that is supported on Windows. Off of the top of my head I can't think of anything besides NetSDKCredentialsFile which is due to the fact it uses Win32 API to encrypt credentials.

    You can use SharedCredentialsFile to register a profile in the credentials file stored under ~/.aws/credentials. This is the same credential stored supported by all of the other AWS SDK and Tools.