Update Environment Variables
Step 1: Update Environment Variables
After all domains have been configured, update each service’s .env file to reflect the new hostnames and any other required settings.
-
Connect to the Azure VM instance (if you are not already connected).
-
Run the environment‑setup script:
cd /home
./env_setup.sh -
Choose the service to edit when prompted:
Which service .env do you want to update?
1) Backend
2) Auth
3) App
4) Exit -
Select your preferred editor (
nano
orvi
), make the necessary changes (e.g., updateDOMAIN
,API_URL
, or any secrets), then save and exit. -
The script automatically:
- Detects whether the file actually changed.
- Restarts only the affected service (
sparrow-api
,sparrow-auth
, orsparrow-app
) if a change was detected, printing a confirmation message such as:
Restarting sparrow-api service...
[INFO] sparrow-api service restarted.
Tip:
• If you open the file but make no changes, the script will skip the restart.
• You can rerun
env_setup.sh
at any time to modify additional services or update existing values.