10

We are currently trying to upgrade our Sitecore 8.1 Environment to Sitecore 9. We are also doing this implementation to Sitecore 9 PaaS and succesfully had several components work, however we are having some challenges on how we can use SOLR in the Azure WebApp. Kindly enlighten us on how we can properly configure the Sitecore 9 hosted on Azure Web App with SOLR.

Thanks in advance.

9

The easiest way to do this is to install a Solr server Virtual Machine. In my case i spun up a simple DS2 V2 Windows 2016 VM. Configured Solr 6.6.2 using SIFless install.Once you get this working for "localhost:8983/solr", you will need to open some ports on the VM firewall to allow connections to that port from an ip address range in your azure VNet (i.e. IP of the Sitecore Web App). Typically its better to allow VNet to VNet peering so its more secure and direct. After this end-point is done, go setup the Solr base address in your Sitecore.config to point to your Solr VM.You may need to do a "Populate solr schema" to kickstart indexing ..etc But if you make it this far, then you have achieved communication between the two.

| improve this answer | |
  • Thanks for the response. We've created two Virtual Networks one for App Service and another one for the Solr Server and connect the two VNets via their Gateways. Then updated the ServiceBaseAddress on the Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config pointing to the Solr Public Ip and run the "Populate Solr Schema" to read the indexes. – Jovit Mayo Jan 23 '18 at 1:51
  • Hi Jovit, seems like you are deploying Sitecore in App Service Environment (ASE) is this correct ? Only ASE provide opportunity to deploy Web Apps in Vnet. – DevUser May 4 '18 at 6:38
  • The below link blog post shared an implementation approach to implement secure Solr IaaS with Sitecore PaaS - see if you are finding useful. medium.com/@sivalingaamorthy/… – Sivalingaamorthy Feb 5 '19 at 12:54
7

I recently created a one-click deployment of Solr to Azure as a web app. I also created a separate branch that presets the proper Sitecore indexes. In other words, after the Solr web app is deployed, you can immediately install Sitecore.

The guts of this technique are contained in the ReadMe and follows the technique outlined by Dan Cruickshank.

How it works

  1. The ARM template azuredeploy.json asks you to set your parameters: subscription, resource group name, app service name, location, solr version, SKU, https only.
  2. It then deploys an App Service Plan and App Service
    1. Sets the Solr version in the appSettings (this is needed later)
    2. Sets TOMCAT Java Container with Java Version 1.8
  3. Once the App Service has been deployed, it uses the sourcecontrols resource to pull a copy of the repo onto the App Service
  4. From here, the .deployment script is executed. This script does a few things:
    1. Executes the Deploy-SolrAzureAppService.ps1 script
    2. Downloads and extracts the requested Solr version (read from app settings)
    3. Copies the web.config to the Solr web root (this is detailed in Dan's post)
    4. (Sitecore-specifics):
    5. Copies default configset
    6. Adds the _uniqueKey wonkiness required for Sitecore
    7. It then iterates over all required Sitecore indexes, creating them all
    8. xDB indexes are separate as they don't have the _uniqueKey requirement

How to use it

Click the 'Deploy to Azure' button and follow the prompts. That's it.

Disclaimer

I would not recommend using this in production without further testing. Though I have heard of others using this approach with success. My main use for this deployment utility is to quickly test out new versions of Sitecore or simply create my own sandboxes.

Follow the one-click deploy to have Solr set up in about 10 minutes. Then add the "Sitecore Experience Cloud" resource in Azure. When it asks to specify the Solr URL, just be sure to enter it properly, e.g. https://mysolrappservice.azurewebsites.net/solr. This approach doesn't require any tinkering of configs, RDP'ing, Kudu'ing. It's painless and it works.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.