Roots Discourse

Setup Azure to work with Trellis

I currently have a client that will be hosting on Azure. I have not used Azure before and am curious how well this can work with Trellis. From looking around it seems like some people have got this setup but I’m not sure exactly where to start or if its even possible. Does anyone have any info to get this setup and working? Any help is much appreciated.

1 Like

Trellis currently only supports Ubuntu 16.04. Microsoft has some documentation on creating an Ubuntu VM using their tools. I’ve never used Azure for Trellis but if you can create the appropriate VM you should be able to provision it just like you would with any Trellis project.

I see that you can create an Ubuntu 16.04 server. We currently have one wordpress site there and the performance has been horrible. I’m really just trying to decide if its worth it to get things running on Azure or hopefully convert the client to Digital Ocean where I know everything works.

All Trellis does is provision an Ubuntu install for you, and then run zero-downtime deploys by swapping symlinks around. If Azure will give you a standard Ubuntu box w/ SSH, I can’t imagine that using Trellis to deploy to it would be that much different than anything else.

Yes it looks like it should. Guess I actually need to access to server so I can test it :thinking:

Just want to circle back here for anyone wondering and let them know that Azure works just fine with trellis.

You simply need to:

  1. create a Ubuntu VM (Trellis now works with Ubuntu 18 or 20)
  2. set up the Azure SSH keys and hosts in your trellis folder. You may need to convert the ssh key to a pub key using ssh-keygen.
  3. Set your environment’s admin_user to your username from the azure VM (you can find this and the ssh info under “Connect”.
  4. Set up all your other trellis config as usual (production/staging site_vars).
  5. Point your DNS at the VM IP.
  6. trellis provision <environment> and trellis deploy <environment>

Worked for me!

Other notes:

  • I added the ssh key to my github repo’s deploy keys. Not sure if i needed to., and then point your DNS at the IP address.
  • I had to install WP after the first deploy, but not after that.
  • I used WP Migrate DB Pro to move my DB and Media up after the first deploy (logged in as usual and then activated/used the plugin).
2 Likes