Skip to content

SSH access

The easiest way to do start an SSH session is to click the 'SSH' link for relevant app from the Azure dashboard, which starts a session in your browser. Or, if you prefer a CLI, and have the Azure CLI app installed, you can use one of the folowing fab commands:

# For PREPROD
fab preprod.open-shell

# For PROD
fab prod.open-shell

Unfortunately, no matter how you start SSH sessions in Azure, the ENV vars set under the 'Configuration' tab aren't pulled in automatically, so you need to run the following withing the session before doing anything else:

export DJANGO_SETTINGS_MODULE=tate.settings.production
export SECRET_KEY={copy/paste value from 'Configuration' tab}
export DATABASE_URL={copy/paste value from 'Configuration' tab}
export ELASTICSEARCH_URL={copy/paste value from 'Configuration' tab}
export REDIS_URL={copy/paste value from 'Configuration' tab}
export REDIS_FORCE_TLS=true

There are some fab commands you can use locally that provide output you can copy and paste for each environment (provided you have access to the environments in Azure):

# For PREPROD
fab preprod.get-shell-variables

# For PROD
fab prod.get-shell-variables

Accessing logs

At the moment, logs are only available in a log file on the application server. First, SSH into the server, then:

tail -f /var/log/wagtail.log