asp.net mvc - StoredProfileAWSCredentials complains it cannot find the profile in a Web application -
i seeing following error being returned when run storedprofileawscredentials
default constructor within web application:
system.aggregateexception: 1 or more errors occurred. ---> system.argumentexception: path cannot empty string or whitespace. parameter name: path @ system.io.directory.getparent(string path) @ amazon.runtime.storedprofileawscredentials.determinecredentialsfilepath(string profileslocation) in d:\jenkins\jobs\build-sdkandtools-release\workspace\sdk\src\awssdk_dotnet35\amazon.runtime\awscredentials.cs:line 354 @ amazon.runtime.storedprofileawscredentials..ctor(string profilename, string profileslocation) in d:\jenkins\jobs\build-sdkandtools-release\workspace\sdk\src\awssdk_dotnet35\amazon.runtime\awscredentials.cs:line 300 @ amazon.runtime.storedprofileawscredentials..ctor(string profilename) in d:\jenkins\jobs\build-sdkandtools-release\workspace\sdk\src\awssdk_dotnet35\amazon.runtime\awscredentials.cs:line 270 @ amazon.runtime.storedprofileawscredentials..ctor() in d:\jenkins\jobs\build-sdkandtools-release\workspace\sdk\src\awssdk_dotnet35\amazon.runtime\awscredentials.cs:line 260
i calling method no parameters. have "default" profile defined has worked when has been used. web application running under iis 6.1 in application pool uses credentials (since aws credentials obtained under login).
i have tried using two-parameter constructor name "default" , local disk path registeredaccounts.json
file (which generated me aws toolkit extension vs 2013).
what happening here , how fix it?
you need set path in web.config file:
<appsettings> <add key="awsprofileslocation" value="path\to\registeredaccounts.json" /> <add key="awsprofilename" value="default"/> <add key="awsregion" value="us-west-2" /> </appsettings>
the credentials file should in format:
[default] aws_access_key_id = xxxxxxxxxxxxxxxxxxx aws_secret_access_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
another option include keys directly in web/app.config:
<appsettings> <add key="awsaccesskey" value="your key" /> <add key="awssecretkey" value="your key"/> </appsettings>
there more details available in documentation.
Comments
Post a Comment