Since the solution is using Sitecore my guide is written for Windows users in mind.
I started out by creating an Ubuntu Server instance in Azure. I added http, https and SSH as Public inbound ports.
Connect to the server using Putty
Install Java on the server
sudo apt-get install openjdk-8-jre
Download the solr tar file (Find the version that works for you Sitecore version here)
wget http://archive.apache.org/dist/lucene/solr/5.5.3/solr-5.5.3.tgz
Setup the Virtual Machines firewall
sudo ufw allow 8983
Unpack the Solr tar file
tar -vzxf solr-5.5.3.tgz
Unpack the Solr tar file
cd solr-5.5.3.tgz bin/solr start
Setup Azure network settings Setting up the Azure network setting as shown here will make the server be available publicly for all the world to see. Consider setting up the appropriate CIDR settings to secure your server
Create a Solr Startup script (solr-start.sh)
nano solr-start.sh
Add the following to the file
cd solr-5.5.3 bin/solr start
Save the file and add execute permission to the script.
chmod +x solr-start.sh
You can test the script simply by using this command
solr-start.sh
Add the shell script to crontab
crontab -e
Add the script to the file as shown below@reboot “CHANGE TO THE PATH TO THE SOLR-START.SH”
When done test that your Solr server is started with the OS by restaring the VM.
As you can see it is not that hard to setup a working Solr server in Azure.
Happy Searching…