79284793

Date: 2024-12-16 13:13:58
Score: 0.5
Natty:
Report link

Putting this out there in case it helps others. I was struggling to run some .Net code that uses the AWS SDK. I couldn't find where credentials were being pulled from on my Windows computer. I renamed my local credentials file and set the typical env vars but my app still was pulling credentials from somewhere else.

I used this command in my code to show the credentials:

    var credentials = FallbackCredentialsFactory.GetCredentials();
    var immutableCredentials = credentials.GetCredentials();
    Console.WriteLine("Access Key: " + immutableCredentials.AccessKey);

I had not remembered ever using the SDK store, and didn't see the credentials defined there, but that "Unofficial Docs" linked in @Craig's post above with the diagram helped debug.

I used the Visual Studio AWS Explorer plugin to set the "sdk:default" user to the credentials I wanted, and it finally worked. https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/keys-profiles-credentials.html

enter image description here

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Craig's
  • Low reputation (0.5):
Posted by: Matthew Allen