Troubleshooting Sitecore on Azure PAAS

I am currently working on Sitecore (9.0.2) implementation on Azure PAAS. Sitecore can take a lot of advantages on Azure PAAS. Be it setting up environments quickly, Maintaining your resources (on your own or with the help of Cloud Solution Provider -CSP), Scaling, and Monitoring.

Troubleshooting of Sitecore on Azure sometimes became complicated and different then your own Infrastructure. I am stating few ways troubleshooting your Sitecore implementation on Azure PAAS based on my recent experience.

Instance not coming up

After setting up initial single setup on Azure PAAS for our Dev environment, we were required to restart the Webapp either manually in case of any issue or automatically as part of deployment process from Octopus. After performing the restart on Webapp, it was showing Running in Azure portal as shown below:

2019-03-31 14_39_35-Home - Microsoft Azure

But when i access the Sitecore instance, i was facing The 503 Service Unavailable error.

4056246_en_2

Even after restarting the Webapp multiple times, result was the same. It shows running in azure portal. But Sitecore instance could not come up.

Continue reading “Troubleshooting Sitecore on Azure PAAS”

Advertisements

Coveo for Sitecore Hive – Understanding Placeholders

Currently, i am working on building search capabilities using Coveo. I am really impressed with the tool and capability it gives while keeping things simple and more in Sitecore context.

Why Coveo components are not getting displayed?

After installing and understanding Coveo (Coveo for Sitecore 90 4.1.729.23 with Sitecore 9.0.2), i started building a sample search page. Coveo team has done a great job for on-demand recording of labs.

While building a search page, I started adding required various components in below hierarchy:

  • Body-main (Custom main container placeholder): Coveo search interface
  • UI Content: Modular Frame
  • UI Header: Coveo For Sitecore Analytics
  • Main section: Results Section
  • Results List: Coveo Results List
  • Boddy-bottom: Coveo Search Resources
  • UI Results Footer: Coveo Pager
  • Results Header (using results header extender): Custom rich text component
  • Main Section: Facets Section
  • Results Header: Results Header Section
  • Results Header Section: Results Sorts Section
  • Results Header: Coveo Breadcrumbs
  • Sorts: Coveo Relevancy & Field sorts

For some of the Coveo components, when you add the components on page, it requires a datasource. So, you’re prompted to create a new or select existing datasource. I left most of the properties unchanged as i was just playing around and wasn’t configuring for actual requirements.

1

And each of the datasource has a field for DOM unique Id with value in format coveo8c7b58dc. From name one can understand that whatever id we specify here will be used to uniquely identify particular component in html.

4

Completed adding components and required datasource. Everything was working fine. Results and other components were getting displayed on page until i changed DOM unique id for my search interface component. As shown below:
3

What is the issue?

  • I first and foremost checked browser’s console for any JavaScript related errors or any error while making a request to Coveo rest point. There wasn’t a single error in console. So, All the Coveo resources were added successfully, i was able to see the Coveo rest endpoint request, i was then able to show the results coming from request but nothing was getting displayed on page.
  • After removal of all possibilities, i was checking presentation details of the search page and i found that DOM unique Id of the Coveo Search Interface component was getting used as part of placeholder key. I renamed unique Id later but that didn’t changed placeholder key and thus it wasn’t showing any component added into search interface component as unique Id and placeholder key wasn’t matching.
    5

How to solve it?

I wanted to have unique identifier for search interface component. So, i used that id and changed the placeholder key accordingly as shown below and everything started displaying on page.

6

Important: Whenever you add Coveo components and if the component requires a datasouce, specify meaningful name in DOM unique Id at the time of adding component itself, before you start adding more component inside that to avoid any issue in future.

Some more information about Coveo Placeholders

  • Dynamic placeholder key which is getting generated for Coveo components is different then normal dynamic placeholder keys of Sitecore 9. See the difference:
    • Sitecore 9 default: /body-bottom/footer-container/footer-links-{C00378EF-EA1F-4090-A640-F8BC10403476}-0
    • Coveo: /body-main/coveo-ui-content_dynamic_coveo-global-search-interface/coveo-ui-main-section/coveo-ui-results_dynamic_coveo45196b99
  • I first checked for mvc.getDynamicPlaceholderKeys pipeline. If Coveo has added any custom processor to generate the dynamic placeholder key using that uniqueId. But i didn’t found anything there which i was strongly believing.
    7
  • I looked at one of the view which ships with Coveo installation from path /Views/Coveo Hive/Sections/Results Section.cshtml and found that Coveo is using it’s own extension method for placeholder. CoveoDynamicPlaceholder
    8
  • It’s defined in Coveo.UI.Components.Extensions.SitecoreHelperExtensions
    coveo-extensions-1
  • There are two overloads for CoveoDynamicPlaceholder method
    coveo-extensions-2
  • First method accepts GroupName as well UniqueId. So, for all components where it requires a datasource, DOM unique Id is getting used as UniqueId from the datasource. When i searched for CoveoDynamiclaceholder in all views of Coveo Hive, found two usages of above method.
    • Coveo Search Interface Component
      • @Html.Sitecore().CoveoDynamicPlaceholder(“coveo-ui-content”, @Model.Id)
    • Placeholder Section
      • @Html.Sitecore().CoveoDynamicPlaceholder(@Model.PlaceholderKey)
    • So, do not forgot to give meaningful name for field DOM unique Id/Placeholder Key when you add any of these two components.
  • Rest of the components are using the second method. Where, UniqueId is not being specified by us, but it’s using UniqueId of the rendering.

Implement great search experience using Sitecore and Coveo. Stay tuned for more posts on this.

Sitecore Habitat Home installation – Build Error & PackageReference

Currently, i am starting a new project which is based on eCommerce solution build in legacy .net platform which i need to move to Sitecore. I wanted to have a look at all the solutions & structures available in community like Habitat, Sitecore Commerce 9.0.2 (A storefront example with the help of SXA), Habitat Home Demo.

I have already configured Habitat solution many times in local or on server without visual studio installed. I also installed Sitecore Commerce 9.0.2 with the help of installation guide provided by Sitecore and an excellent blog by @viet_hoang_sc: https://buoctrenmay.com/2018/03/09/step-by-step-guide-for-sitecore-commerce-9-installation-on-your-machine/ . Now, it was turn for Habitat Home Demo.

Continue reading “Sitecore Habitat Home installation – Build Error & PackageReference”

NameLookupList field with query and dynamic item/field sources

Sitecore provides NameValueList & NameLookupValueList fields for storing Key/Value pair of dynamic n number of data. These fields are highly usefull though they don’t come to use that often like Treelist or Multilist fields.

Recently, for one of my requirements, i was needed to lookup the key instead of the values. And values will be entered manually. I was already aware of the such custom field created by @jammykam which you can find here: https://jammykam.wordpress.com/2015/03/08/custom-sitecore-field-for-storing-keyvalue-data-with-lookups/ 

Continue reading “NameLookupList field with query and dynamic item/field sources”

Sitecore EXM 9.0.1 – Email from existing page not working

Sitecore EXM is a tool to use for creating Email Marketing Campaigns within Sitecore. Sitecore EXM brings number of advantages over widely used third party tools like MailChimp, ConstantContact etc. If you’re not sure of anything below:

  • What is Email Marketing?
  • How Sitecore EXM works?
  • What are the differences between Sitecore EXM and third party tools like MailChimp, ConstantContact?
  • Advantages of Sitecore EXM
  • SUGCON India 2018 happened recently in Bangalore – http://www.sugcon.in

Please look the sessions slide page of SUGCON India 2018 http://www.sugcon.in/2018-session-slides/ where i have answered all your queries above in my session Introduction to EXM and how Marketing Automation helps. Click here to directly download the slide for EXM.

Steps to create email campaign based on existing page?

This is one of the great feature Sitecore EXM provides us to create an email campaign based on existing page of your Sitecore website. This allows you to send the exactly same page or page based on different device to be sent to your desired recipients. You can follow below steps to create an email campaign based on existing page in your website. But before that, you required to install Sitecore 9 update – 1 (9.0.1). With which Sitecore EXM comes by default installed.  Continue reading “Sitecore EXM 9.0.1 – Email from existing page not working”

How your SXA site gets resolved?

I have been looking at the Sitecore SXA for quite a long time now. If you are not aware of Sitecore SXA – Visit here. Having worked on full software development life cycle and on different technologies, It always interests me to look something which connects Front-End technologies and Back-End technologies. SXA provides a great platform for the developers to be able to build site robustly, Manage the Themes, Manage the Media library assets etc.

If you are working/playing with SXA, you will be aware of SXA Site Manager. It displays all the sites created using the SXA and the default (website) site as well. When i checked the <sites> section of the Sitecore.config, i couldn’t find the entries for the sites created using SXA. And it is obvious as doing such will restart your IIS application pool. I was curious how site gets resolved as i have already used Multiple Site Manager module in past which follows the similar kind of approach. Let’s find it out.

Continue reading “How your SXA site gets resolved?”

Sitecore SPEAK 2.0 CRUD operation part 2 – List component & Query Datasource

In this part we will see the operations like Listing & Delete in a Speak application. What i am doing here? I first wanted to create a form to save the data. If so, visit the first part here https://pratiksatikunvar.wordpress.com/2017/08/30/sitecore-speak-2-0-crud-operation-part-1-form-component. We will walk through ListControl & QueryDataSource in detail to complete the exercise along with binding complex (DropLink) field.

Create a blank SPEAK application

We already seen how to create a speak page using the branch template DashboardPage for 2.0 version in previous blog post. Let’s follow the same steps and create a page under /sitecore/client/Your Apps/DemoApp We will call it Departments for our exercise.

Continue reading “Sitecore SPEAK 2.0 CRUD operation part 2 – List component & Query Datasource”