ThingWorx Analytics Installation > Connecting Analytics Server to Azure PostgreSQL
Connecting Analytics Server to Azure PostgreSQL
* 
Connecting Analytics Server to Azure Postgre SQl database is an optional step. This is required to be done post installation only if you have chosen Azure Postgresql as the Analytics database.
Analytics Server supports Azure PostgreSQL Flex server.
Complete the following steps for connecting the Analytics Server to the Azure PostgreSQL database. The steps provided are applicable for both, Linux and Windows installations.
1. As a pre requisite, ensure that Analytics Server is successfully installed.
2. Create an Azure Postgres instance.
3. In the ThingWorx Analytics installation folder, open the file <INSTALL_DIR>\standalone_jars\async-api.yml with any text editor.
4. Find and edit the following section as given below.
database:
driverClass: "org.postgresql.Driver"
user: "<userName>@<databaseName>"
password: ${microservices.db.user.password} # Could hard code password here for testing
url: "jdbc:postgresql://<AzurePostgresDBaddress>:5432/<databaseName>?sslmode=require&autosave=always "
initialSize: ${microservices.db.minSize}
minSize: ${microservices.db.minSize}
maxSize: ${microservices.db.maxSize}
properties:
hibernate.dialect: "org.hibernate.dialect.PostgreSQLDialect"


flyway:
# Locations to scan recursively for migrations. (default: db/migration)
locations:
- /job-create-schema
- /filter-create-schema
- /migration-postgres # update this variable too
- /migration-common
5. If you need the db password to be encrypted into keystore, update the bin/update-encrypted-password.sh script in the following section.
.....
# ---------------------------------
# Flink Key Password
# ---------------------------------
fk) KEYNAME="flinkKeyPasswordKey"
TYPE="Flink Key Password"
;;

# ---------------------------------
# Db Password
# ---------------------------------
db) KEYNAME="databaseCreds"
TYPE="Db Password"
;;

# ---------------------------------
# help
# ---------------------------------
-h)
displayHelp
exit 0
;;
......
6. In config/system-environment-variables.properties, add the following line.
microservices.db.user.password=encrypted
7. Run the following command.
./update-encrypted-password.sh db <AzurePostgresPassword>
8. Restart the Analytics Server.
Was this helpful?