AWS SDK for .NET can't access credentials with IIS

0

I have written some code to retrieve my secrets from the AWS Secrets Manager to be used for further processing of other components. In my development environment I configured my credentials using AWS CLI. Once the code was compiled I am able to run it from VS and also from the exe that is generated.

My question is that once it's on my IIS production server, I repeat these steps but it doesn't work, because I run the steps as the user account I'm logged in as, but the IIS process doesn't run as the logged in user, so the code can't get what it needs.

I want the IIS process to be able to access these credentials under its own user profile. How do I place the credentials under that profile? I do not want credentials just randomly somewhere on the system.

ETA: This is an on-prem production server...

  • I'm also having the same problem (also on-prem). My secrets code works on the server when I have it as a console application but when I put it in a .net core app hosted on IIS, it cannot access the credentials store. I see no one has answered your question correctly. Were you able to figure it out?

1 Answer
0

You will need to setup a IAM Role and attach that role to the EC2 instance upon launch. You can follow this guide.

For an application that is built using the AWS SDK for .NET, when the application constructs a client object for an AWS service, the object searches for credentials from several potential sources. The order in which it searches is shown in Credential and profile resolution.

profile pictureAWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions