I have been struggling to implement secrets manager on .NET Core. It always returning me with Socket Exception and HTTPRequestException on GetSecretValueAsync method call, while it is working on my colleagues PC.
SocketException: A socket operation was attempted to an unreachable network HttpRequestException: A socket operation was attempted to an unreachable network
![]()
I have already setup the credentials file needed in AWS default profile located at C:\Users\USERNAME.aws\credentials on Windows and also on each IIS App Pool .aws folder. All credentials stored in UTF-8 format previously ANSI.
Here is sample of the credentials that i got with MFA authentication:
Here is my aws credentials configuration and folder location:
Mostly my setting with my colleague are the same. Now I'm almost at a dead end. If anybody have experience or AWS Web Services Team willing to help me with the solution for this, please let me know. Thank you. Cheers.
var data = secretManager.GetSecretValueAsync(
new GetSecretValueRequest
{
SecretId = configName
}
).Result;
UPDATE:
I found out the real issue here but still got no solution yet. Because I can't really see where does the secrets manager get the credentials from. And for your information, this method works on .NET Framework in my PC.
I have finally found out the real issue here. It is actually because I need to allow IIS_IUSRS group user to access IIS system profile folder. Thank you everyone!