User guide

Specifying a Profile
Profiles are the preferred way to use credentials in an application running locally.You can store profiles
in the SDK Store or in the credentials file.You don't have to specify where the profile is stored. Just
reference the profile by name, and the SDK for .NET retrieves the corresponding credentials, as described
in the previous section.
The recommended way to specify a profile is to define an aws element in your application's App.config
or Web.config file.The associated credentials are incorporated into the application during the build
process.
The following example specifies a profile named development.
<configuration>
<configSections>
<section name="aws" type="Amazon.AWSSection, AWSSDK"/>
</configSections>
<aws profileName="development"/>
</configuration>
Another way to specify a profile is to define an AWSProfileName value in the appSettings section of
your application's App.config or Web.config file.The associated credentials are incorporated into the
application during the build process.
The following example specifies a profile named development.
<configuration>
<appSettings>
<add key="AWSProfileName" value="development"/>
</appSettings>
</configuration>
This example assumes that you are using the SDK Store or a credentials file in the default location, under
the current user's home directory. If your profiles are stored in a credentials file in an arbitrary location,
specify the location by adding a profilesLocation attribute value to aws. The following example
specifies C:\aws_service_credentials\credentials as the credentials file by using the
recommended aws element.
<configuration>
<configSections>
<section name="aws" type="Amazon.AWSSection, AWSSDK"/>
</configSections>
<aws profileName="development" profilesLocation="C:\aws_service_credentials\cre
dentials"/>
</configuration>
Another way to specify a credentials file is with the appSettings element.
<configuration>
<appSettings>
<add key="AWSProfileName" value="development"/>
<add key="AWSProfilesLocation" value="C:\aws_service_credentials\creden
tials"/>
</appSettings>
</configuration>
Version v2.0.0
12
AWS SDK for .NET Developer Guide
Configuring AWS Credentials