Pages

13 April, 2021

Sitecore Publishing Service - Recap

This blog is a recap of the Sitecore Publishing Service.

Sitecore introduced Sitecore Publishing Service along with Sitecore v8.2. It is a standalone service which reads the dedicated Publish Queue, create Manifest of items to be changed and process the content movement from source to target.

This standalone service is optional and independent of out of the box Sitecore publishing mechanism in CM. This service helps clients where there is a frequent content changes and multiple content authors. This reduces the load on the CM instance as the entire publishing mechanism will be lifted and handled by Publishing Service. This service also raises the events to clear the cache after the publish. In case if we want to raise custom event, we can patch it and let this service raise the event.

To install this service, there are two steps.

  1. Sitecore Publishing Service which needs .NET core and can be hosted in IIS or any other platform. 
  2. Sitecore Module which needs to be installed in the Content Management server. 
    • This module enabled a Publishing Dashboard which will read the publish job queue and provide a status to the content authors. 
    • It also creates a role by which we can control the full publish to certain users. 
    • It creates a set of tables in the master DB so the connection string user for master DB should have access to create table while this package is installed. 

14 September, 2020

Enabling Token based authorization for RESTful ItemService in Sitecore 9.3

There is a great number of articles available to enable Token based authorization for RESTful ItemService in Sitecore. Since then it was introduced in Sitecore 8.x, there has been multiple change in namespace for configuring the Signing Provider with the connection string name. 

As per the documentation, the patch for configuring the signing provider for Sitecore 8.2 is here.
<!-- Configuring the Signing Provider for Token Based Authentication for Sitecore 8.2 -->
<configuration>
  <sitecore>
   <api>
    <tokenSecurity>
     <signingProvider type="sitecore.services.infrastructure.sitecore.security.symetrickeysigningprovider, sitecore.services.infrastructure.sitecore">
        <param desc="connectionstringname">sitecore.services.token.securitykey</param>
     </signingProvider>
    </tokenSecurity>
   <api>
  </sitecore>
</configuration>

For Sitecore 9.3, there has been few changes and re-structure to the assembly and namespaces. 
  • Notice that instead of Sitecore.Services.Infrastructure.Sitecore, Sitecore.Services.Infrastructure should be used. 
  • Name of the class has some difference between 8.2 and 9.3 - "SymmetricKeySigningProvider"
<!-- Configuring the Signing Provider for Token Based Authentication for Sitecore 9.3 -->
<configuration>
  <sitecore>
   <api>
    <tokenSecurity>
     <signingProvider type="Sitecore.Services.Infrastructure.Security.SymmetricKeySigningProvider, Sitecore.Services.Infrastructure">
        <param desc="connectionStringName">Sitecore.Services.Token.SecurityKey</param>
     </signingProvider>
    </tokenSecurity>
   </api>
  </sitecore>
</configuration>

10 September, 2020

Sitecore - [Dilithium] Data corruption in master

When using Unicorn to serialize the content and share it with team, there are times when you will end up having inconsistency with the data like having unversioned field data in versioned table in master DB. Because of this, you may get error like "Data Corruption" when you sync using Unicorn. 

[Dilithium] Data corruption in master://{fc5c3451-dfde-4778-9901-5d0b1da1e212}! Field 19a69332-a23e-4e70-8d16-b2640cb24cc8 (unversioned) had a value in the versioned fields table. The field value will be ignored.

When looking for a solution, I found Mikael has written a SQL script which will identify these inconsistencies and provide an option to remove the incorrect data. This will stop this data corruption error message. Thank you Mikael for the script. 

https://mikael.com/2019/11/clean-up-sitecore-database-and-avoid-corrupt-published-content/

https://gist.github.com/mikaelnet/a57faa9a7f9b35b9bba1118787b4266d

01 September, 2020

View the list of installed .NET version

To get the list of .NET version in a windows machine, you can run the below command. 


Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*", "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" | Where {$_.DisplayName -like '*.NET*' -and $_.DisplayVersion -like '4.*'} | Select-Object DisplayName, DisplayVersion

30 August, 2020

Access Host SQL Server from Virtual Machine

When using VMWare, you may be trying to access the SQL server in the host machine from the VM. Be default, SQL server remote connection is disabled and also the host machine firewall may be blocking the 1433 port which is normally used for SQL connection. In order to enable the firewall and the TCP port, you can follow the below steps mentioned in the SO. 

https://stackoverflow.com/a/24898663/3016347