Connecting JIRA applications to Azure SQL

These instructions will help you connect JIRA Server or JIRA Data Center to an Azure SQL database.

Before you begin

1. Create an Azure SQL database

Create an Azure SQL database. See Quickstart: Create a single database in Azure.

Requirements

  • Collation: When creating the database, make sure to set the right collation in Additional settings, as you won't be able to change it later. Collation types supported by JIRA are SQL_Latin1_General_CP437_CI_AI and Latin1_General_CI_AI.


2. Allow JIRA to connect to the database

You need to add the IP address of your JIRA server to the database's firewall rules to allow JIRA to connect to your Azure SQL database. See Azure SQL database firewall rules.


3. Configure JIRA to connect to the database

There are two ways to configure your JIRA server to connect to your Azure SQL database.

tip/resting Created with Sketch.

Finding connection strings

When connecting JIRA to the database, you’ll need to provide connection details, such as hostname, port number, and database name. You can find them in the Azure portal by opening your deployed database and going to Connection strings.


  • Using the JIRA setup wizard  — Use this method, if you have just installed JIRA and are setting it up for the first time. Your settings will be saved to the dbconfig.xml file in your JIRA application home directory.

    Show me how to do this...

    The JIRA setup wizard will display when you access JIRA for the first time in your browser.

    1. In the first screen, 'Configure Language and Database', set Database Connection to My own database.
    2. Set Database Type to Microsoft SQL Server.
    3. Fill out the fields, as described in the Database connection fields section below.
    4. Test your connection and save.
  • Using the JIRA configuration tool  — Use this method, if you have an existing JIRA instance. Your settings will be saved to the dbconfig.xml file in your JIRA application home directory.

    Show me how to do this...
    1. Run the JIRA configuration tool as follows:
    2. Navigate to the Database tab and set Database type to Microsoft SQL Server.
    3. Fill out the fields, as described in the Database connection fields section below.
    4. Test your connection and save.
    5. Restart JIRA. 

Database connection fields

The sections below describe the fields you'll need to fill out when connecting JIRA to your database. 


In Setup Wizard/Configuration tool...
FieldDescription / Example
Hostname

The name or IP address of the Azure SQL server. 

Example: sqlserver.database.windows.net

Port

The TCP/IP port that the Azure SQL server is listening on. You can leave this blank to use the default port.

Default: 1433

Database

The name of your Azure SQL database (into which JIRA will save its data).

Example: jiradb

Username

The user that JIRA uses to connect to the SQL Server server.

Example: jiradbuser@sqlserver

PasswordThe user's password — used to authenticate with the Azure SQL server.
Schema

The name of the schema that your Azure SQL database uses. 

Default: dbo

In dbconfig.xml...
FieldDescription / Example
Hostname

The name or IP address of the Azure SQL server. 

-

<url>jdbc:sqlserver://;serverName=sqlserver.database.windows.net;

portNumber=1433;databaseName=jiradb</url>

Port

The TCP/IP port that the Azure SQL server is listening on. You can leave this blank to use the default port.

-

<url>jdbc:sqlserver://;serverName=sqlserver.database.windows.net;

portNumber=1433;databaseName=jiradb</url>


Database

The name of your Azure SQL database (into which JIRA will save its data).

-

<url>jdbc:sqlserver://;serverName=sqlserver.database.windows.net;

portNumber=1433;databaseName=jiradb</url>

Username

The user that JIRA uses to connect to the SQL Server server.

-

<username>jiradbuser</username>

Password

The user's password — used to authenticate with the Azure SQL server.

-

<password>yourpassword</password>

Schema

The name of the schema that your Azure SQL database uses.

-

<schema-name> dbo </schema-name>

Sample dbconfig.xml file

For more information about the child elements of <jdbc-datasource/> beginning with pool in the dbconfig.xml file above, see Tuning database connections.

<jira-database-config>
  <name>defaultDS</name>
  <delegator-name>default</delegator-name>
  <database-type>mssql</database-type>
  <schema-name>dbo</schema-name>
  <jdbc-datasource>
    <url>jdbc:sqlserver://;serverName=sqlserver.database.windows.net;portNumber=1433;databaseName=jiradb</url>
    <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
    <username>adminsql@sqlserver</username>
    <password>T3ddybear</password>
    <pool-min-size>20</pool-min-size>
    <pool-max-size>20</pool-max-size>
    <pool-max-wait>30000</pool-max-wait>
    <validation-query>select 1</validation-query>
    <min-evictable-idle-time-millis>60000</min-evictable-idle-time-millis>
    <time-between-eviction-runs-millis>300000</time-between-eviction-runs-millis>
    <pool-max-idle>20</pool-max-idle>
    <pool-remove-abandoned>true</pool-remove-abandoned>
    <pool-remove-abandoned-timeout>300</pool-remove-abandoned-timeout>
    <pool-test-on-borrow>false</pool-test-on-borrow>
    <pool-test-while-idle>true</pool-test-while-idle>
  </jdbc-datasource>
</jira-database-config>
Last modified on Sep 8, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.