Tips: Find out about Content hub version in use

I just wanted to share this useful snippet to find out about the Content hub version in use within your instance, just browse this url api/status/version and you will get a useful JSON with all the versions in use within your content hub

source: https://docs.stylelabs.com/contenthub/3.3.x/content/user-documentation/administration/data/import-export-package/intro/instance-version.html

Advertisement

Sitecore Content Hub SSO troubleshooting tips

I have recently been more involved with Sitecore Content Hub and I just wanted to share a few tips that maybe useful within the troubleshooting of SSOM

  1. Url to force the login page and ignore the cookies already in place for your login

/account?forcepassive=true

2. Debug your ACS

if you are in the scenario that you can login using SSO but you are missing the correct credentials on Content Hub you may need to review the claims issued by your SAML provider for the SSO, the simpler way is to get your /sso/Acs page from your browser console and review the SAML token that should look like:

SAMLResponse=PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIElEPSJfM2I2ZjZlYjhhNDZmOTY5MzUzNDAiICBJblJlc3BvbnNlVG89ImlkNGYzNzVjOGQ5MmY3NDcwN2I3M2Q2OTZkNTcxMTVlMzYiICBWZXJzaW9uPSIyLjAiIElzc3VlSW5zdGFudD0iMjAyMS0xMS0zMFQxNTo1NjoxNC4xNTZaIiAgRGVzdGluYXRpb249Imh0dHBzOi8vaWtlYS1wLTAwMS5zaXRlY29yZWNvbnRlbnRodWIuY2xvdWQvc3NvL0FjcyI%2BPHNhbWw6SXNzdWVyIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iPnVybjppbmdrYS1pY293LXByb2QuZXUuYXV0aDAuY29tPC9zYW1sOklzc3Vlcj48c2FtbHA6U3RhdH

this can be easily decoded using tools such as: https://www.samltool.com/decode.php

and the response should look like

<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="_3b6f6eb8a46f96935340"  InResponseTo="id4f375c8d92f74707b73d696d57115e36"  Version="2.0" IssueInstant="2021-11-30T15:56:14.156Z"  Destination="https://YOURINstance.sitecorecontenthub.cloud/sso/Acs"><saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:SSOISSUEREntity.auth0.com</saml:Issuer><samlp:Status><samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/></samlp:Status>

Tip: Disable Marketing Indexes when Analytics are turned off

I have noticed that even if Analytics and tracking are turned off and Sitecore is used only as Content Management, all the SOLR indexes are still in place and in some circumstances, your Sitecore CM instance can have a performance hit related to SOLR…

In this tip I am sharing a snippet to disable the SOLR indexes that are effectively not required in case you are using only CM functionalities of Sitecore…

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/&quot; xmlns:role="http://www.sitecore.net/xmlconfig/role/&quot; xmlns:search="http://www.sitecore.net/xmlconfig/search/"&gt;
<sitecore role:require="Standalone or ContentDelivery or ContentManagement" search:require="solr">
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<indexes>
<index id="sitecore_marketingdefinitions_master">
<patch:delete />
</index>
<index id="sitecore_marketingdefinitions_web">
<patch:delete />
</index>
<index id="sitecore_marketing_asset_index_master">
<patch:delete />
</index>
<index id="sitecore_marketing_asset_index_web">
<patch:delete />
</index>
<index id="sitecore_testing_index">
<patch:delete />
</index>
<index id="sitecore_suggested_test_index">
<patch:delete />
</index>
<index id="sitecore_personalization_index">
<patch:delete />
</index>
<index id="sitecore_fxm_master_index">
<patch:delete />
</index>
<index id="sitecore_fxm_web_index">
<patch:delete />
</index>
</indexes>
</configuration>
</contentSearch>
</sitecore>
</configuration>

Sitecore Symposium 2021 Recap

Here I have put together the key take away from Sitecore symposium 2021

Sitecore vision

Composable DXP:

Sitecore Send – MooSend

SitecoreOrderCloud: Four51

Sitecore CDP & Sitecore Personalize: Boxever

Sitecore Search: Reflektion

Sitecore Roadmap for the coming year

Sitecore Developer portal has been launched https://developers.sitecore.com/

Sitecore Symphony – Frontend as a Service big news for modern Sitecore developers!

Sitecore search coming in Spring 2022

Sitecore 10.2 has been released in november: https://doc.sitecore.com/en/developers/102/what’s-new/what-s-new-in-sitecore-experience-platform-10-2.html

Tip to retrieve Sitecore Package Installation history

in case you are not aware and you want to find when a package or installation module was installed in Sitecore, there is a secret path for you in the core database

sitecore/system/packages/installation history

here you will find a list of who has installed what and when… note that if the package was installed as part of the ARM template this may be missing in the history….

Tricks to configure the backup of a Sitecore WebApp

In case you are running you Sitecore instance in an Azure WebApp this is an essential trick to configure correctly the backup of your webApp for CD and CM server

As you probably are aware Sitecore FileSystem backup works pretty well but obviously if the folder to backup is too big, you may have some issue backing up and restoring your app.

Therefore my golden trick is to configure the backup filter for your web site excluding the following folders using _backup.filter in the root of your site, here the list of folders to exclude in most of the scenarios on CD & CM instances:

  • App_Data/MediaCache
  • App_Data/logs
  • App_Data\DeviceDetection
  • Temp

in case you want to explore further options for your backup of the webapp this documentation explain all the additional settings

https://docs.microsoft.com/en-us/azure/app-service/manage-backup#:~:text=To%20exclude%20files%20and%20folders,.azurewebsites.net%2FDebugConsole%20.

Coveo Hidden Errors behind SOLR errors

Sometime Coveo hidden behind SOLR errors… one issue that I have found is the following one:

Could not find add method: AddIndex when loading my sitecore instance

Everything points to an unexplained SOLR error but in reality I still had to configure Coveo and that’s why was throwing random errors….

The secret to fix this issue is to temporarily disable Coveo with the following appsettings in web.config   <add key=”coveo:define” value=”disabled”/>

once I disabled Coveo, Sitecore instance will load and I can proceed with Coveo Modules installation and configuration…

Sitecore 10 – Asp.net core – exploring ModelBoundView

One of the big news within Sitecore 10 is the support for ASP.NET core Rendering SDK for dotnet core 3.1 (note that in November MS released .net 5 and hopefully Sitecore will update the support and starting kit for .net 5

Sitecore released a starter kit and I would suggest to check the following links to get you started with the environment configuration:

https://doc.sitecore.com/developers/100/developer-tools/en/walkthrough–using-the-getting-started-template.html

Anyway I wanted to give a simple explanation and breakdown of the ModelBoundView component that is the equivalent of the classic MVC ViewRendering exploring all the elements required to get your first ModelBoundView working.

Typically you would use a ModelBoundview when you want to bind simple content to a frontend component without having any specific backend/data composition logic but you envision a straight mapping between Sitecore Items and a cshtml view…

Code elements required within the asp.net core solution:

@model ContentBlockModel
<div>
@* Important: Self-closing tags will not work when rendering text fields with the Sitecore tag helpers. *@
<h1 class="contentTitle" asp-for="Title"></h1>
<div class="contentDescription">
<sc-text asp-for="Text"></sc-text>
</div>
</div>

here you can see two example of syntax asp-for and sc-text in action

using Sitecore.LayoutService.Client.Response.Model.Fields;
namespace MyProject.Models
{
/// <summary>
/// An example of binding to component fields (usually a serialized datasource item).
/// </summary>
public class ContentBlockModel
{
public TextField Title { get; set; }
public RichTextField Text { get; set; }
}
}

important elements within the startup.cs

Sitecore elements

data Template

Rendering creation using Json Rendering Template

rendering datasource configuration:

Content Item

Assigning the rendering to the Item

rendering datasource configuration

Layout Service

in case you need to trouble shoot having a look at the layout service is always a good idea http://sc10nsc.dev.local/sitecore/api/layout/render/jss?item=/&sc_apikey={xxxxxxxxxxxxxxxxxxxx}

if you were wondering how it looks like:

further reference to the Sitecore documentation and sample project:

https://github.com/Sitecore/Helix.Examples/tree/master/examples/helix-basic-aspnetcore

https://doc.sitecore.com/developers/100/developer-tools/en/sitecore-asp-net-rendering-sdk.html

Azure Best Practice – Backup your CD/CM WebApp

This is a very simple but very important tip that I would recommend almost in all Sitecore PAAS implementation that I have worked on…

Unfortunately Azure OOTB does not enable the backup of your Azure WebApp, that means that if you delete some files or break something within your deployments, there is not an easy way to get back in time and restore it the files that you have changed.

My recommendation is to enable the Backup functionality of CD & CM web apps so that you can always easily restore a copy back in time in case something goes wrong.

The Backup will cover the entire FileSytem of your webApp therefore all the original Sitecore solutions + all the config files + All the deployed assets

You can either backup on demand or backup on the schedule, the schedule option or take a backup before deployment is my recommendation

Azure Best Practice – Configure Application Initialization to reduce Cold Startup time

This tips is required in the case you have multiple instances of your web app and it will prevent Azure bringing into the load balancer the cold instances until the cold instances have been warmed up and ready to serve traffic effectively..

Application Initialization was introduced few years ago with IIS 8 https://docs.microsoft.com/en-us/iis/configuration/system.webserver/applicationinitialization/

but it is surprising to see that not all the website hosted on Azure use this useful feature…

<system.webServer>
<applicationInitialization
doAppInitAfterRestart="true"
skipManagedModules="true">
<add initializationPage="/" />
<add initializationPage="/page1/" />
<add initializationPage="/Category/page2/" />
</applicationInitialization>
</system.webServer>
view raw AppInit hosted with ❤ by GitHub