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개 답변
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
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인