Azure web app multi container - Create first admin user

I have set up an Azure web app docker multi container with passbolt and mariadb in a docker-compose.yml file.
In this setup, I am unable to SSH into the web app and unable to run docker exec to add the first admin user.

How can I create the first user when these options are unavailable.
Are there environmental variables I can use, or any other trick via Azure CLI?


hey @theck1 great question! I did a little playing around to see what the best plan would be. The following worked for me:

  • Create a script with the contents su -m -c "/usr/share/php/passbolt/bin/cake passbolt register_user -u test@passbolt.local -f yourname -l surname -r admin" -s /bin/sh www-data adjusting to match what you want as your admin account
  • Mount this via your docker-compose file
  • Add a line before /usr/bin/ -t 0 db:3306 -- / in the commands section that executes the script
  • start up with the docker-compose up command

This will then create the user and send an email with the invite link so it is vital that you have your email configured via environment variables. You’ll also need to remove that line for the script after your user is created.

This also assumes you are using the root docker image, for the non-root you’d have to adjust the script to remove the su to www-data user portion