---
title: "Create datasource based profiles"
canonical: "https://support.appfire.com/space/SQL/74320217/Create%20datasource%20based%20profiles"
format: markdown
---
<span style="color: #000000">Profiles provide the means to connect, query, and retrieve relevant data to be displayed on pages. Using profiles ensures that sensitive information such as database connection details and credentials of the database user can be hidden from others using the macro on Confluence pages. </span>

> ❌ ### Important information:
> ❌ 
> ❌ <span style="color: #000000">Administrators must ensure to use credentials of database users with </span><span style="color: #000000">*read-only privileges*</span><span style="color: #000000"> for profiles intended for use with the </span><span style="color: #000000">*SQL Query macro*</span><span style="color: #000000">.</span> <span style="color: #000000">We recommend creating a read-only database user to be used specifically with the </span><span style="color: #000000">*SQL for Confluence *</span><span style="color: #000000">- </span><span style="color: #000000">*SQL Query*</span><span style="color: #000000"> macro.</span>

# <span style="color: #000000">Steps</span>

<span style="color: #000000">To create profiles, administrators must:</span>

1. <span style="color: #000000">Navigate to </span><span style="color: #000000">***Manage apps***</span><span style="color: #000000"> > </span><span style="color: #000000">***SQL Configuration***</span><span style="color: #000000"> > </span><span style="color: #000000">***Data source profiles***</span><span style="color: #000000">.</span>
2. <span style="color: #000000">Click the </span><span style="color: #000000">**Add profile**</span><span style="color: #000000"> button to open the Add profile wizard.</span>
  1. <span style="color: #000000">Select your database. See </span><span style="color: #000000">[here](#sqlCld_100_config_profile_add01)</span><span style="color: #000000"> to learn more.</span>
  2. Provide connection and user credentials to access the specified database. Click [this](#) for more details.

> ⚠️ ### About Macro Security:
> ⚠️ 
> ⚠️ Administrators can specify trusted users and restrict access to specific macro parameters or parameter values in ***SQL Configuration ***> ***Macro security ***and add another layer of security. Refer to [this documentation](https://bobswift.atlassian.net/wiki/x/5AAdbw#sqlCld_100_config_macroSecurity) to learn more.

3. <span style="color: #000000">Save your profile.</span>

<span style="color: #000000">The newly created profile is now listed in the Data source profiles page.</span>

## > Macro (anchor)

<span style="color: #000000">Add profile wizard - Step 1</span>

![image](media://93e00775-6f3b-46fc-8f0d-c2f037630b87)

<span style="color: #000000">Select the database that the macro must access, query, and retrieve data from.</span>

## > Macro (anchor)

<span style="color: #000000">Add profile wizard - Step 2</span>

<span style="color: #000000">After selecting the relevant SQL database, provide details such as the database connection details, user authentication method, and more. </span>

![image](media://2292e1c3-239e-41f1-a7e8-ad4fa0fa62f8)

<span style="color: #000000">The following table lists the parameters to be provided:</span>

| Section | Parameter | Default value | Description |
| --- | --- | --- | --- |
| > Macro (anchor) | <span style="color: #000000">Profile name</span> |  | <span style="color: #000000">Enter the name to be used for the profile. Users can then select from the list of profiles displayed in the macro editor. </span><span style="color: #000000">*This field is mandatory. *</span> |
| <span style="color: #000000">Database connection</span> | <span style="color: #000000">Hostname</span> |  | <span style="color: #000000">Enter the host name or the IP address of the database server to be accessed. </span><span style="color: #000000">*This field is mandatory. *</span><br>> ⚠️ ### Configuration note
> ⚠️ 
> ⚠️ <span style="color: #000000">Ensure that the database host allows connections from the </span><span style="color: #000000">*SQL for Confluence*</span><span style="color: #000000"> app. This requires updating the host's firewall settings to allow these IP addresses:</span>
> ⚠️ 
> ⚠️ - <span style="color: #000000">184.73.28.18</span>
> ⚠️ - <span style="color: #000000">52.45.207.55</span>
> ⚠️ 
> ⚠️ <span style="color: #000000">If these addresses are not allowed, errors are generated and relevant messages are shown.  </span> |
| <span style="color: #000000">Port</span> |  | <span style="color: #000000">Enter the port number required to access the relevant database on the server. </span><span style="color: #000000">*This field is mandatory.*</span> |
| <span style="color: #000000">Database</span> |  | <span style="color: #000000">Enter the database name the macros must query for information. </span><span style="color: #000000">*This field is mandatory.*</span> |
| <span style="color: #000000">Authentication type</span><br>> ❌ ### Important information:
> ❌ 
> ❌ <span style="color: #000000">Administrators must ensure to use credentials of database users with </span><span style="color: #000000">*read-only privileges*</span><span style="color: #000000"> for profiles intended for use with the </span><span style="color: #000000">*SQL Query macro*</span><span style="color: #000000">.</span> | <span style="color: #000000">Authentication type</span> | *Basic* | <span style="color: #000000">Select the authentication method to be used to connect to the specified database. </span><span style="color: #000000">*This field is mandatory.*</span><br><span style="color: #000000">The options are as follows:</span><br>- <span style="color: #000000">*Basic*</span><span style="color: #000000"> - This is the default authentication method. This method uses the basic user authentication (user name and password) to validate access to the required database.</span>
- <span style="color: #000000">*AWS IAM*</span><span style="color: #000000"> - This authentication method is used to manage access to Amazon Web Services (AWS) and resources securely with access keys. </span><br>> ⚠️ The [Amazon Relation Database Service (RDS) documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAM.html) specifies the databases supported with IAM authentication as follows:
> ⚠️ 
> ⚠️ - Amazon RDS for MySQL
> ⚠️ - Amazon RDS for PostgreSQL
> ⚠️ 
> ⚠️ For more information about authenticating to a database instance using IAM, see [IAM database authentication for MySQL and PostgreSQL](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html).<br>> ✅ Refer to [this article](https://aws.amazon.com/iam/) for more information about IAM, and [this article](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) to know more about AWS access keys used to authenticate users. |
| <span style="color: #000000">User</span> |  | <span style="color: #000000">Enter the user name to be used to log in the required database or AWS account. Based on the value of </span><span style="color: #000000">*Authentication type*</span><span style="color: #000000">, provide the following:</span><br>- <span style="color: #000000">*Basic*</span><span style="color: #000000">: Enter the user name or ID to be used to log into the required database. </span>
- <span style="color: #000000">*AWS IAM*</span><span style="color: #000000">: Enter the user ID of the AWS account used to log into the required database.</span><br><span style="color: #000000">*This field is mandatory.*</span> |
| <span style="color: #000000">Password</span> |  | <span style="color: #000000">Enter the password to be used along with the user name to access the required database. </span><span style="color: #000000">*This field is mandatory.*</span><br>> ⚠️ - <span style="color: #000000">This field appears only if </span><span style="color: #000000">*Authentication type*</span><span style="color: #000000"> is </span><span style="color: #000000">*Basic*</span><span style="color: #000000">.</span>
> ⚠️ - <span style="color: #000000">All profile sensitive information (such as passwords) are encrypted to provide enhanced security.</span> |
| <span style="color: #000000">AWS region</span> |  | <span style="color: #000000">Enter the AWS region (specified when creating the AWS account) where the relevant database is hosted. </span><br><span style="color: #000000">An AWS region is a physical location that contains clusters of data centers where cloud based services are accessed over the internet. For more information about regions, refer to the </span><span style="color: #000000">[AWS global infrastructure documentation](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/)</span><span style="color: #000000">. </span><br>> ⚠️ <span style="color: #000000">This field is displayed only if </span><span style="color: #000000">*Authentication type*</span><span style="color: #000000"> is </span><span style="color: #000000">*AWS IAM*</span><span style="color: #000000">.</span> |
| <span style="color: #000000">Key ID</span> |  | <span style="color: #000000">Enter the AWS key ID of the user to log in the required database. </span><span style="color: #000000">*This field is mandatory.*</span><br>> ⚠️ <span style="color: #000000">This field is displayed only if </span><span style="color: #000000">*Authentication type*</span><span style="color: #000000"> is </span><span style="color: #000000">*AWS IAM*</span><span style="color: #000000">.</span><br><span style="color: #000000">Access keys are long-term credentials for an IAM user or the AWS account root user. For more information about AWS access keys, refer to the </span><span style="color: #000000">[AWS IAM documentation](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html)</span>. |
| <span style="color: #000000">Secret access key</span> |  | <span style="color: #000000">Enter the AWS secret access key (part of a user's AWS access key) to be used to log in the required database. </span><span style="color: #000000">*This field is mandatory.*</span><br>> ⚠️ <span style="color: #000000">This field is displayed only if </span><span style="color: #000000">*Authentication type*</span><span style="color: #000000"> is </span><span style="color: #000000">*AWS IAM*</span><span style="color: #000000">.</span><br><span style="color: #000000">For more information about AWS access keys, refer to the </span><span style="color: #000000">[AWS IAM documentation](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html)</span>. |
| <span style="color: #000000">Test connection</span> |  | <span style="color: #000000">Click this link to test whether a connection can be established with the required database using the specified authentication details. After the test is completed, either of the following indicators are shown:</span><br>> Macro (nested-table) |
| <span style="color: #000000">Extended parameters</span> | <span style="color: #000000">Limit rows processed</span> | <span style="color: #000000">*250*</span> | <span style="color: #000000">Select the maximum number of rows to be processed and displayed on Confluence pages. This setting prevents queries from using excessive resources that can result in a large number of rows. </span><br><span style="color: #000000">Individual queries can use the </span><span style="color: #000000">*Limit rows processed*</span><span style="color: #000000"> parameter in the </span><span style="color: #000000">[macro editor](https://bobswift.atlassian.net/wiki/x/GwE7dg)</span><span style="color: #000000"> to override this value.</span><br><span style="color: #000000">The following options are available from a selection list:</span><br>- <span style="color: #000000">*250*</span>
- <span style="color: #000000">*500*</span>
- <span style="color: #000000">*1000*</span>
- <span style="color: #000000">*2500*</span>
- <span style="color: #000000">*5000*</span>
- <span style="color: #000000">*10000*</span>
- <span style="color: #000000">*25000*</span><br>> ⚠️ <span style="color: #000000">Refer to </span><span style="color: #000000">[this note](#sqlCld_100_config_paramPriority)</span><span style="color: #000000"> to know more about the default behavior for common parameters available in the configuration as well as macro editor.</span> |
| <span style="color: #000000">Limit query time</span> | <span style="color: #000000">*120*</span> | <span style="color: #000000">Select the time in seconds that a query can take before a forced timeout. This prevents queries that take too long, from impacting other users. </span><br><span style="color: #000000">Individual users can use the </span><span style="color: #000000">*Limit query time*</span><span style="color: #000000"> parameter in </span><span style="color: #000000">[macro editor](https://bobswift.atlassian.net/wiki/x/GwE7dg)</span><span style="color: #000000"> to override this value.</span><br><span style="color: #000000">The following options are available from a selection list:</span><br>- <span style="color: #000000">*1*</span>
- <span style="color: #000000">*5*</span>
- <span style="color: #000000">*10*</span>
- <span style="color: #000000">*30*</span>
- <span style="color: #000000">*60*</span>
- <span style="color: #000000">*120*</span><br>> ⚠️ <span style="color: #000000">Refer to </span><span style="color: #000000">[this note](#sqlCld_100_config_paramPriority)</span><span style="color: #000000"> to know more about the default behavior for common parameters available in the configuration as well as macro editor.</span> |

> Macro (anchor)



> ⚠️ ### Priority used for common parameters in configuration and macro editor:
> ⚠️ 
> ⚠️ <span style="color: #000000">There are some parameters, such as </span><span style="color: #000000">*Limit rows processed*</span><span style="color: #000000"> or </span><span style="color: #000000">*Limit query time*</span><span style="color: #000000">, that are available in Global configuration, profile configuration, as well as macro editor. Any parameter defined at the macro level overrides the values set at the Global or profile configuration levels. The order of overriding the default setting is:</span>
> ⚠️ 
> ⚠️ <span style="color: #000000">***Macro level parameter > Profile configuration > Global configuration***</span>

## > Macro (anchor)

<span style="color: #000000">Add profile wizard - Step 3</span>

<span style="color: #000000">Click </span>**Save profile**<span style="color: #000000"> to create the profile, or, </span><span style="color: #000000">**Cancel**</span><span style="color: #000000"> to go back to the Data source profiles screen. The newly created profile is now displayed along with the connection status on the Data source profiles screen.</span>

# <span style="color: #000000">Other resources</span>

<span style="color: #000000">Click any of the given links to learn more about the app:</span>

- <span style="color: #000000">[App configuration](https://bobswift.atlassian.net/wiki/x/5AAdbw)</span><span style="color: #000000"> for configuration related details</span>
- <span style="color: #000000">[SQL Query macro](https://bobswift.atlassian.net/wiki/x/GwE7dg)</span><span style="color: #000000"> to learn more about the macro</span>