I become Sitecore 9 certified at Sitecore MVP Summit 2018

Hi there,

Well, I was a bit stressed about this certification. I have not worked that much in Sitecore lately and I did not really prepared for this exam. I participated at Sitecore MVP Summit 2018 and up until the evening before the day the exam was scheduled I was not 100% that I really want to take the exam, but made my mind and in the morning at 8:00 I was present in the room to take the exam, even that I was bit tired.

After signing up at the location – took a bit to do it – the exam started. There were 50 questions, with a countdown of 1h and 30 minutes, but apparently the room was booked for something else at 09:00, so I had a bit more than 1 minute for each question. That went quite well and I’ve passed the exam and now I am a Sitecore® 9.0 Certified Platform Associate Developer.

A study guide for the exam can be found here: https://sitecore.freshdesk.com/support/solutions/articles/16000067853-sitecore-certified-platform-associate-developer-exam-study-guide-

Sitecore-cert-details.jpg

 

Do not change global.asax in Sitecore 9!

This is a rule of thumb in Sitecore 9: Do not change global.asax. There are other ways to run a piece of code at the start of the Sitecore 9.

Until now I have used 2 ways in Sitecore 9 to run a piece of code at the start of the solution. In similar manner you can do it in Sitecore 8 as well.

#1 Using Sitecore Owin middleware.

With release of Sitecore 9, Sitecore decided to embed a OWIN module and with that there are a couple of pipelines that can be used.

What’s OWIN Middleware?

It stands for Open Web Interface for .Net. It is a new standardized interface between web servers and applications. It stands as a middleware to be used in a pipeline to handle requests and associated responses. OWIN provides a decoupling layer that allows two frameworks with disparate object models to be used together.

Sitecore 9 has implemented the OWIN Pipeline directly into the core platform and with that we can integrate external identity provider logins and no only.

You can initialize the OWIN configuration like this:

And the code:

A good usage example is implemented in the module Sitecore SignalR.

Then Sitecore already implemented Federation Authentication in Sitecore 9 using OWIN middleware and you can extend it for your needs. Bas wrote first article on how to Enable federated authentication and configure Auth0 as an identity provider in Sitecore 9.0.

Also, you can write your own implementation using OWIN, but will give you a proper example in my next article that is touching this topic and how to have custom authentication for your Sitecore Web Api.

In Sitecore 8 you can use module Sitecore-Owin to add OWIN support to your solution. Works quite well, as I have already used it to customize the Sitecore SignalR module.

#2 Using Initialize Pipeline in Sitecore.

This functionality was also available in Sitecore 8, in case you were not aware of that. This is used to start some functionality at Sitecore application start-up.

In a clean web application it possible to use global.asax, but Sitecore decided some time ago (not sure with what version exactly) to make globas.asax private. Instead you need to use the initialize pipeline. The initialize pipeline is started at the application start. Initialize pipeline is defined in Sitecore.config.
In order to use initialize pipeline it’s needed to created a new include config file with the new processor.

And the code:

Anders Laub  also has an article about this subject on this blog article Global.asax events and Sitecore pipelines.

One thing that this initialize pipeline can be used is to implement dependency injection into your solution One way to implement Dependency Injection for Sitecore Habitat.

Or you can with this functionality to register a Web Api Route using RouteTable from System.Web.Routing. Sitecore Habitat is using this functionality to register the routes like in this example:

Hope all this information is going to help you into your implementations.

How to Sitecore 9 uninstall – my take

I have installed Sitecore 9 on a machine, but I needed also to clean up at one point.

There are already a couple of articles/references about this subject:

But I’ve decided to use Rob’s uninstall scripts referenced here in his introductory article about SIF-less, but in case you want to do it in a manual way, I wrote some steps below.

But also this process requires some extra assistance/adjustments as I am having the necessary SQL server installed on a different machine.

Before running the scripts that was generated by SIF-less, make sure to install SQL Server PowerShell Module by opening PowerShell as administrator by running this command:

Install-Module -Name SqlServer -AllowClobber

For more information look at this page that has the official documentation for installing the SQL Server PowerShell module.

Then copy the remove json files from the folder Scripts that comes with the the SIF-less archive into the folder for your XP0 Configuration files, defined by $PSScriptRoot in the install script and then copy the Invoke psm1 files from the folder Scripts that comes with the the SIF-less archive into the folder that has your uninstall script.

Extra: if Sitecore 9 was installed using a different folder than the default one, using instructions from here, then the removal scripts remove-sitecore-XP0.json or remove-xconnect-xp0.json have to be modified too, in similar way.

Manual way to uninstall an instance of Siteocre 9 involves few steps, but it is not that bad. Assuming that your installation instance is prefixed with xp0Demo then:

  • Remove the two xConnect windows services (with sc.exe delete [servicename] in poweshell as administrator or in cmd.exe as administrator too)
    • xp0Demo.xconnect-MarketingAutomationService
    • xp0Demo.xconnect-IndexWorker
  • Remove the Sitecore and xConnect website and application pools from IIS
  • Remove the Sitecore and xConnect webroots
  • Remove the databases from SQL Server prefixed with xp0Demo
  • Stop the Sorl service and remove the indexes prefiex with xp0Demo from folder c:\solr\solr-6.6.2\server\solr\. Do not forget to start the Solr service again.
  • Hosts entries that are prefixed with xp0Demo should be removed too

Also I’ve tested the procedure on a Sitecore 9 update 1 and its exactly the same, not changes required.

Sitecore 9 update 1 installation with SQL Server on a different server

Sitecore 9 update 1 was just released. So it’s quite fresh from the oven.

I’ve just tried the installation on a web machine that uses SQL Server installed on a different server and made some discoveries related with prerequisites  needed for the installation.

So beside the standard prerequisites mentioned in the installation documentation (must log into https://dev.sitecore.net/ before downloading) there are couple requirements that have to be installed on your webserver:

    1. Microsoft SQL Server TransactSQLScriptDom – install both SqlDom.msi for x64 and x86 – install this before DacFx
    2. Microsoft Shared Management Objects for SQL Server 2016  – install both SharedManagementObjects.msi for x64 and x86
    3. Microsoft® SQL Server® 2016 Feature Pack
      1. Microsoft ODBC Drivers for Microsoft SQL Server – install both msodbcsql.msi for x64 and x86
      2. Microsoft Command Line Utilities 13 for SQL Server – install both MsSqlCmdLnUtils.msi for x64 and x86
    4. SQL Server PowerShell Module – by opening PowerShell as administrator and  run this command:
      Install-Module -Name SqlServer -AllowClobber
    5. Extra (so I find it later, even that is in the official documentation): Microsoft Visual C++ 2015 Redistributable – was introduced in this Sitecore 9 update 1 as its needed by ChilkatDotNet46.dll. Download from here.

I guess that’s all.

Happy installing and let me know if you need any assistance.

How to install Sitecore 9 on Windows 8.1

There are a couple of articles about Sitecore 9 on a Windows 8.1 development machine, and since it’s bit out of hand for me to upgrade to Windows 10 I’ve decided to take the bull by the horns and finally do it. Even that I’ve lost a bet with @SitecoreClimber that will manage to install Sitecore 9 to my Windows 8.1 in fist-second week of the launch without any troubles.

Windows 8.1 does not have Powershell 5.1 as its needed by SIF, so you can install it from here, as Windows Management Framework 5.1 includes also Powershell 5.1. An alternative way it to use this command choco install powershell if you are using Chocolatey.

After a restart of the machine it’s time to install Sitecore Install Framework and Sitecore Fundamentals. So in a Windows Powershell opened as Administrator execute this:

Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2
Install-Module SitecoreInstallFramework
Update-Module SitecoreInstallFramework

Run the following command in Windows Powershell to validate the modules installed:

Get-Module SitecoreInstallFramework –ListAvailable

After this you can continue with the installation of SOLR. The script that Jeremy Davis made in his blog post it’s not going to work as New-SelfSignedCertificate has different parameters in Windows 8.1, so you could use my adjusted script.

After Solr its installed and up and running make sure than all the other prerequisites are meet:

  1. Sitecore License must have xDB enabled
  2. MS SQL Server 2016 SP1 or later
  3. MS SQL Management Studio
  4. .Net Framework 4.6.2 or later
  5. Web Deploy 3.6
  6. Java Runtime Environment
  7. Packages for XP Single (On Premises deployment)
  8. Microsoft SQL Server Data-Tier Application Framework (DAC Fx) (install both DacFramework.msi for x64 and x86)
  9. Microsoft SQL Server TransactSQLScriptDom (install both SqlDom.msi for x64 and x86)
  10. Extra step (added by me): Microsoft Shared Management Objects for SQL Server 2016 (install both SharedManagementObjects.msi for x64 and x86) since I do not have on my dev machine MS SQL Server 2016 SP1 or later or MS SQL Management Studio

Then make sure that you follow the changes to the scripts that Fabian is presenting here.

In short the changes are:

  1. Create a self-signed certificate in Windows 8.1
  2. Change xconnect-createcert.json
  3. Change the official installation script

Extra notes:

Note 1:

  • Make sure that the script New-SignedCertificateWindows81.ps1 is located in same place as the installation script so that can be picked up
  • Make sure that JRE bin folder does exist in the PATH Environment Variable, otherwise New-SignedCertificateWindows81.ps1 will not work.

In case you already have a SSL certificate in your machine then the changes that Fabian is presenting are not needed as you should use this article for installing your solution Sitecore 9 installation with existing SSL that I’ve wrote last week.

Note 2: The steps #8, #9 and #10 from the prerequisites should be installed in all situations when you install Sitecore 9 and you do not have on your web server MS SQL Server 2016 SP1 or later or MS SQL Management Studio

Note 3: On my way to install Sitecore 9 when I’ve installed only x64 version of add-ons from prerequisites ( steps #8, #9 and #10) and apparently was not enough as I was getting bunch of errors, so I had to install x86 versions too.