Azure PostgreSQL

How to use our Azure-deployed PostgreSQL database in the cloud for development.

You should go with this option if you need data to interact with and won't be changing the Strapi models at all. More specifically, if you are developing on the frontend, use this staging database to get relevant data, so you don't have to populate it on your local environment.

Do not change Strapi models without guidance

Register your IP Address in the Azure database

The database is restricted by IP to disallow any bad actors from gaining access to our database. Navigate to https://whatismyipaddress.com, and send that IP address to Daniel or Davon to get it registered.

Set up your staging.env file

We use an environment variable file in the project to delegate which databases to use. Create a staging.env file in the root Strapi folder (strapi-api). In the staging.env file, paste the following code:

staging.env
DATABASE_HOST=corl-portal.postgres.database.azure.com
DATABASE_PORT=5432
DATABASE_NAME=corl-portal
DATABASE_USERNAME=corl@corl-portal
DATABASE_PASSWORD=***ASK DANIEL/DAVON FOR PASSWORD***
DATABASE_SSL=false
NODE_ENV=staging

Run your development server while connected to the staging database.

To run your development server with this database connection, in your terminal/command line, run:

Make sure that you're connected to the staging environment; check the logs under Project information. The Environment should be set to staging.

Make note of the Environment and its corresponding value, staging.

Last updated

Was this helpful?