Closed abjrcode closed 5 years ago
It looks like you are not using the .NET Core Setup Extensions. You can read some documentation on this here. Let me know if that helps.
So to get the behaviour described in the documentation I must be using the Extensions
I thought they were just added convenience and the core logic is still within the other assemblies
I will give them a try.
Thank you for your help
So this is a bit like going down the rabbit hole.
I managed to pass the dummy credentials in but then it came to my mind that I might have the same issue with region, so I tried passing that as well and now it fails to authenticate although the service endpoint is pointing towards the local dynamo container.
I guess my question is now like this:
Basically I want to reach the following goal: My tests are completely independent from the global environment.
Sorry if I am asking too much and thank you for your help
What does the region default to if it cannot find it in any of the fallback mechanisms and the service URL points to localhost
?
Also it seems you cannot anymore provide custom service client configuration?
If you specify a region, it will override the service url. If you are working with localhost, you shouldn't specify the region. https://github.com/aws/aws-sdk-net/blob/662be216d79d4c34f058d4e1bb1b7891e4d682fc/sdk/src/Core/Amazon.Runtime/ClientConfig.cs#L117-L136
Thanks for your kind help sir.
According to documentation it should be possible to override the profile location and profile name via AppConfig or directly by setting the properties on AWSConfigs.
Tried both approaches without avail
Expected Behavior
Running this:
then later this:
Then it should load the credentials from my custom credentials file.
Current Behavior
It doesn't load the credentials from the specified location. Checking the source code I don't even see how that will happen:
From what I see the behaviour described in the documentation page only applies to BCL and not .NET Core?
Context
I wanted to supply dummy credentials because I am using DynamoDb container in my integration tests but it was still trying to look for the default credential profile in
~/.aws/credentials
which doesn't necessarily exists. Basically trying to make the tests portable and independent of global environment by supplying fake credentials.Your Environment
.NET Core Info
dotnet --info
:Runtime Environment: OS Name: Windows OS Version: 10.0.18362 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.402\
Host (useful for support): Version: 2.1.4 Commit: 85255dde3e
.NET Core SDKs installed: 2.0.0 [C:\Program Files\dotnet\sdk] 2.1.4 [C:\Program Files\dotnet\sdk] 2.1.104 [C:\Program Files\dotnet\sdk] 2.1.202 [C:\Program Files\dotnet\sdk] 2.1.402 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]