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
Please do not change Strapi models while using this database. The database will become un-synced if more than one developer is actively iterating on the database.
Furthermore, if you do use this option, please make sure you have pulled the latest code regarding database migrations before changing anything.
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:
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=stagingYou must ask Daniel and Davon for the DATABASE_PASSWORD used in the staging.env file before trying to connect. Please make sure that you are not committing the environment variables file in your GitHub. Check your staged changes in Git before committing to do so.
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.

Last updated
Was this helpful?