Skip to content
December 1, 2018 / kiranpatils

Custom language for Sitecore Azure PaaS Web Apps

Challenge:

We are porting one of our client’s App from Older Sitecore version and infrastructure (IaaS) to Sitecore 9 and Azure Paas Web App.

They have 20+ languages and we learnt that they have few custom languages as well (en-TH, en-VN, en-ae). You might get excited and say, You can use : https://marketplace.sitecore.net/en/Modules/Custom_Language_Registration.aspx

But If you said so, Then you must’ve missed last line, App is on Azure PaaS web App. And Custom Language Tool is Windows desktop application. Which you can’t run on Azure web App. Interesting?

Wondering, How we resolved it? And you are also facing similar challenges? Then this post is for you.

Solution:

First of all, we did quick search and found following links:

This link found from first link is really nice read and confirms one thing THAT IT’S NOT POSSIBLE to do and then provokes some really good questions : https://blogs.msdn.microsoft.com/benjaminperkins/2018/06/11/implementing-custom-cultures-cultureinfo-localize-azure-app-service/

You cannot, at this moment, create a custom culture on an Azure App Service.  Cultures are part of the standard operating system and require changes to the registry to modify or add them.  An Azure App Service runs in a sandbox which does not allow code or script to modify the registry.  I do not work on the team responsible for this Windows feature, but I have confidence the team puts lots of diligence into providing the fundamental capabilities to match the requirements of most global cultures.

Second blog gave some good alternative solution using URL Rewrite.

But before we do that, We thought to see what all cultures and languages are available on Azure Web App  and was able to get that list. You can also download it from here : https://drive.google.com/open?id=1lmNoZPJRyvkTaAPo8dTMaEaM0VVidhdE

We couldn’t find exact language. But we found alternative languages, Which we could use for our Sitecore solution and after consulting with our client we used it! Reference list is as below:

  • en-TH -> th-TH
  • en-VN -> vi-VN
  • en-ae->ar-ae

Hope you found this helpful!


Advertisements
December 1, 2018 / kiranpatils

How to reference and deploy Sitecore hotfix DLLs?

Challenge

Recently we were facing 503 error on our Sitecore 9.0.2 version Sitecore App deployed on Azure App (Blog on that topic soon)

We reached out to our common friends — Sitecore Support team and they gave me Two Hotfix DLLs :

  • Sitecore.Kernel
  • Sitecore.ContentSearch

Til this point of time, I got DLLs like Sitecoe.Support.SOMNUMBER.DLL and it was easy to deploy. I can copy in Assemblies/Lib folder in your directory, and reference it from your Project. And it will be deployed on higher environments.

But If you are wondering how to do it for these two DLLs? As they are coming from Sitecore’s Nuget feed in your current solution. Are you? Then this post is for you.

Solution

As you do, I also did a quick search and foud this from Sitecore’s official doc : https://doc.sitecore.com/developers/82/sitecore-experience-platform/en/sitecore-public-nuget-feed-faq.html

That was disappointing 😦 Then thought to reach out to our internal Sitecore experts and following great ideas came up:

  1. Private Nuget server : This makes sense. But have to reach out to client and ask them to spin up new nuget server and deploy DLL there. But was unable to figure out, how it will resolve from nuget references [Sitecore] and Custom nuget having same DLLs with same name.  As I was not clear and had client team’s dependencies thought to look for other solution.
  2. Local Reference : Another plan was to use old school approach, Where you created Assemblies/Libraries/Libs folder under your Project directory and instead of nuget use local reference in all your projects. But it had two challenges:
    1. We are using Helix and we have lot of projects, where we need to do these updates ~20. Which I was not sold.
    2. In future, If we have to do version upgrade. We have to again do these changes manually for all projects. Lot of work Now and in future – not efficient. So, thought to think of another approach
  3. Post build step : Another idea was to provide post build steps in last project, which copies hotfix’d DLLs. That could have fixed local development environment challenges. But we use Teamcity, Octopack and Octopus deployment and this idea would need additional steps from DevOps team. Which is fine for now. But in future — Same efforts needs to be done to undo it. So, this was also not a good idea.

Then I applied my 99 things learning, Step away from keyboard : https://github.com/97-things/97-things-every-programmer-should-know/blob/master/en/thing_69/README.md

And got a new idea:

By default nugget looks for DLL file from Packages folder and if exist, it doesn’t download and uses it as a reference DLL. For example : Sitecore.Kernel.DLL can be found under <YOURPROJDIR>\packages\Sitecore.Kernel.NoReferences.9.0.180604\lib\NET462

This was Eureka moment. Where I thought to do this:

  1. Copy new DLL from Sitecore hotfix package and pasted it under
    <YOURPROJDIR>\packages\Sitecore.Kernel.NoReferences.9.0.180604\lib\NET462
  2. Committed : Packages folder and
    Sitecore.Kernel.NoReferences.9.0.180604\lib\NET462 folders
  3. That’s it!
  4. it worked on Local – Teamcity and Octopus!

This helped? You found better approach than this? I’m all ears!

Happy Coding! 🙂

December 1, 2018 / kiranpatils

Toolcore publishing fix for TLS 1.2

Challenge:

We love automation and so as our clients. For almost all our clients, We do automatic deployment. Using Teamcity and Octopus.

As you know Sitecore automatic deployment is not easy, it involves the lot of things like ASP.NET MVC Files, DLLs, Sitecore Items, and Sitecore publishing. For Sitecore publishing we use : http://fortis.ws/fortis-collection/toolcore/publishing/

Which works best. But recently it was failing and we started getting error related to TLS after integrating it with Sitecore 9.0.2 installation deployed on Azure App Service.

You are also facing same error with Toolcore Publishing module? Then this post is for you!

Solution:

We did quick search and came across this SO thread — Which has some pointers for solution : https://sitecore.stackexchange.com/questions/13706/all-sitecore-8-2-x-azure-topologies-seem-to-be-effected-because-of-tls-issues

Microsoft disabled support of TLS 1.0 on App Services recently (https://social.msdn.microsoft.com/Forums/en-US/9dace9cb-a1a8-4f77-af26-324bc2b6740e/tls-plans-for-azure-app-service?forum=windowsazurewebsitespreviewenter link description here)

Technical details can be found here: Transport Layer Security (TLS) best practices with the .NET Framework

https://kb.sitecore.net/articles/688903

Any .Net call relying on TLS 1.0 is leading to authentication issues on Azure App Services:
Exception
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. --->
System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. --->
System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host.

We tried switching our Azure App service to TLS 1.0 and it worked!

I know, You must be thinking this is not the best solution. And so, as we!

You might have noticed from above links that, If any application is making HttpRequest using .NET HttpRequest class and using TLS 1.0 then it won’t work. And Solution is either changing code (ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12) and using TLS 1.2 or compile your application using >=.NET Framework 4.6.0 version and above as it uses TLS 1.2 by default. This makes perfect sense!

But how does it impat Toolcore publishing? After digging bit we understood that FortisCollections.Toolcore.Publish.Service has .asmx web service which is deployed on Sitecore CM Server and FortisCollections.Toolcore.Publish.Runner console application has Proxy which is invoked.

This was Eureka moment!

Thought to check with Jason (repo contributor) via github : https://github.com/Fortis-Collection/Toolcore/issues/5

And parallely thought to fix it by forking it and compiling it with new version — And it worked!

Obviously, So, as you I got busy after that and never got a chance to share it back with larger community. Couple of days back, one of my colleague, reached out to me requesting compiled DLL package and that was a moment, I realized this weekend. Have to share it with larger world!

PR Created : https://github.com/Fortis-Collection/Toolcore/pulls and waiting for Jason to approve. But till then you can use it if you are also facing similar issue!

Hope you go home after fixing this! 🙂




September 3, 2018 / kiranpatils

Sitecore 9 Architecture and Scaling Basics

Challenge:

Sitecore 9 comes with ~50 roles. Which is obvious in this Microservices era. Sitecore team has done good job documenting all the roles and scenarios as well providing videos to help us understand.

I wanted to document a quick reference, Which we can refer quickly. It helped me to connect the dots. Thought to share with you as well!

Solution:

Here you go:

While working on this document, Got connected with SUGNCR team. They were hosting their second in-person meetup. So, thought to present this topic there along with my friend – Brijesh Patel

Event was really great and nicely organized — It was really great to meet lot of Sitecore passionate people in-person.

Slides are as below:

Pre-Session survey results are as below:

As you can see ~30 people were there and average rating was 2.4. They had mid level knowledge about Storage Roles, Cloud Services and Scaling.

Our session’s goal was to increase this knowledge and that’s what has been done in above given slides. Due to some reason, we haven’t gathered post-sesion survey. But session feedback, Which we got from organizers is astonishing – Thank you so much audience!

Hope this helps!

July 21, 2018 / kiranpatils

Sitecore Troubleshooting Demos

Challenge:

Have been crafting on Sitecore since a decade and have came up with lot of unique Sitecore challenges.

Which I’ve been sharing with you via this blog, And have received good feedback from you — And I appreciate you for that. If you haven’t came across it yet. Then you can visit following links:

  1. https://sitecorebasics.wordpress.com/category/performance/
  2. https://sitecorebasics.wordpress.com/tag/troubleshooting/
  3. https://www.scribd.com/document/132658804/Sitecore-Troubleshooting-Path

While learning Debugging/Troubleshooting Tess’s blog helped me a lot. Especially Labs (You as well?!) :

https://blogs.msdn.microsoft.com/tess/2008/02/04/net-debugging-demos-information-and-setup-instructions/

Sine long time, I wanted to build something similar for Sitecore community. But most of the times being super busy, and at times being lazy [Happens with you as well!? ;-)]. But when I thought to present at SUGCON India I thought this is the best time to work on this idea! (If you couldn’t attend SUGCON India then you missed a great event — Everyone did a great job to make this happen first time at India. You can see great pictures here : http://www.sugcon.in/2018-pictures/)

I’m excited to share, What I have done with you. Which I already shared at SUGCON India and SUGUAE events.

Solution:

You can get it from here : https://github.com/klpatil/SCbuggybits (Read Me file should help you to get started) This lab contains 3 Bugs in the form of 3 Labs. It will be fun to find it and fix it!

My Session slides are here : http://www.sugcon.in/wp-content/uploads/2018/05/Troubleshoot-Sitecore-Like-a-Ninja-Kiran-Patil-SUGCON-India-2018.pdf

My session video is here :

Give it a try and let me know what you think? You found new bug in your day to day life, And would like to add it scbuggybits, I encourage you to do so!

Hope this helps you to fix your issues and let’s you go home on time! 🙂

July 21, 2018 / kiranpatils

TDS ProxyDisabler error with Sitecore 9

Challenge:

While working for my SUGCON Talk I was trying to setup Sitecore solution with TDS. I came across following error while doing Get Sitecore Items:

TDS-error.png

Solution:

My Sitecore version was 9.0.1. I did some Google search. But couldn’t find anything. So, thought to reach out hedgehog team and they suggested this:

The proxy disabler issue was fixed in one of the later versions of TDS 5.6. Upgrading to the latest version of TDS should fix the problem.

And that did the trick! After upgrading to TDS 5.6 it worked. Thanks to Hedgehog support team!

Hope this helps!

April 8, 2018 / kiranpatils

Fix for Database error during Sitecore 9 Installation

Challenge:

While installing Sitecore 9 for few of the exciting things I’m working on [Soon to be shared!] faced some issues. Which is obvious with any new things. I’m sure you as well. Not tried yet?! Then this quote is for you:

In a day when you don’t come across any problems, you can be sure that you are travelling in a wrong path.

https://quotefancy.com/quote/32294/Swami-Vivekananda-In-a-day-when-you-don-t-come-across-any-problems-you-can-be-sure-that

So, thought to write it down. With the goal that it helps someone, somewhere on this earth! [Might be on moon someday! :)]

I had to do couple of attemps to do Sitecore 9 Installation with same prefix. But at one point of time. It was stuck with this error:

Warning: The database containment option has been changed to None. This may result in deployment failure if the state of the database is not compliant with this containment level.

You are also facing the same? Then this post has fix for you!

Solution:

Here are the steps I did:

  1. Connected to SQL Server Management Studio and deleted databases which were with the prefix, which was trying to install.
  2. Configured Contained Database Authentication as per Installation guide’s chapter Prerequisites and Requirements [Why? Note from SC documentation “To enable SQL server to allow for the creation of users when using the Sitecore Install Framework, ensure that the target SQL Server is configured in a way that allows users and logins to be contained at the database level. To do this, set the contained database authentication server configuration option to 1 (on): “]
sp_configure 'contained database authentication', 1;
GO
RECONFIGURE;
GO

Now, try again. And if all good. You should see your brand new Sitecore 9 instance up and running!

Good reads:

  1. https://chebalt.wordpress.com/2017/11/22/sitecore-9-installation-tips/
  2. http://blog.baslijten.com/gotchas-while-installing-sitecore-9-using-the-sitecore-installation-framework/
  3. https://docs.microsoft.com/en-us/sql/relational-databases/databases/contained-databases

Hope this helps!

%d bloggers like this: