I have been lucky enough to configure it for lot of projects to make it deployment process smoother — Especially with TeamCity. Recently, I was doing it for one of the project where Target server works over HTTPS only. If you know internals of TDS Classic – It uses .asmx service as connector to do lot of magic.

Tried to search it over Web. But couldn’t find anything useful. So, I thought will write so it appears for you when you search next — Yes, You are facing same problem? Then this post have a solution. Which might work for you.

Solution:

I thought to check with \Hedgehog folks and I really like their support team – Very prompt, Very sharp and super helpful. I got connected with Kliment Klimentov. And he/she had been super helpful related to this issue.

If you have installed Valid SSL Certificate then you no need to do anything

But as we were trying to deploy on lower environment – DEV/QA/UAT — Where we were using IIS Dev Certificate

Which to be honest, I got confused. Not because of steps. But because my lack of knowledge on this Certificate things. So, read some basics. And tried to break this steps in more simplified manner and thought to share my learnings with you:

My few of the questions were — Okay this steps needs to be done on server then what should be done on client? How to map certificate with site? And so on..

Basically, You need to do Self-Signed Certificate related configurations on both Buid Server [You can also call it as Client] and Web/App Server [Server]

Build/Client Server

When you are on step to select Certificate Store, Make sure you select “Trusted Root Certification Authorities”

That’s it!

Have a happy and smooth deployment — Go home with smiling face!

Filed under: Sitecore, Tips and Tricks Tagged: Deployment, Sitecore, TDS]]>https://sitecorebasics.wordpress.com/2017/08/31/sitecore-tds-classic-deployment-over-https/feed/0kiran PatilSpeed up project load time for Helix and TDS based Solutionhttps://sitecorebasics.wordpress.com/2017/08/31/speed-up-project-load-time-for-helix-and-tds-based-solution/
https://sitecorebasics.wordpress.com/2017/08/31/speed-up-project-load-time-for-helix-and-tds-based-solution/#respondThu, 31 Aug 2017 17:22:32 +0000http://sitecorebasics.wordpress.com/?p=1369]]>Me and my colleague have been talking and we were noticing VS Hang during branch switch for one of our Helix based solution. Which has the lot of TDS Projects. We noticed when we switch branch. TDS Code generation starts code generation. Which Technically we don’t want. We want it when we do some item level changes. If you are also noticing similar challenge. Then TDS Classic team has solution for you, Which you might have not been aware/thought of.

Go to Visual Studio – Options and from here – You can configure it as per your need. And it will be persisted across all Visual Studio Instances as it is Global setting.

Recently, We wanted to get few critical things done for one of our client before they Go-Live. We had a couple of weeks to get all those things done with minimal changes. [Normal scenario — Correct? ;)].

With that condition, We had to do bulk template change for 1000+ Media Items, as we added some functionality which was required in new template. We had following options:

They both are great solution for our challenge. Especially Sitecore Powershell. But If you see both need deployment/package install which has the lot of footprints and as I mentioned earlier, we wanted to have minimal changes before we Go-Live!

So, We thought we will build a simple aspx page [With CodeFile] So, It can be deployed without any App Pool Restart and once used tool can be deleted — Use and Throw. I’m sure you all must have built one/another tool like this. But once your Challenge was solved you struggled to find it. So, as I That’s why I thought to blog this!

Solution:

This is how it works:

You can download code from here and modify it as per your need and if you think it can help someone on this earth — Please share your great work!

It is interesting – How this idea came up. Basically, was browsing Facebook page and while doing that – My Internet was slow and during image load process — I noticed an ALT Tag — Which had something like this and when Image got loaded. It had exactly same thing!

While this thing got stuck somewhere in mind. Came across following videos [Which I’m sure most of you as well]:

And that revoked the thought process. Especially — For those who are not as privileged as you and me to see the world. But through technology if it helps them visualize — That will help!

Then came across this link : https://azure.microsoft.com/en-us/try/cognitive-services/ [“Microsoft Cognitive Services let you build apps with powerful algorithms using just a few lines of code. They work across devices, keep improving, and are easy to set up. Try the Cognitive Services APIs for free.”] — This is really awesome – As For me impacting human lives and making it better using technology is the only thing which drives me in to this field. I’m sure for lot of you as well!

And was impressed to see how it works — It just works! – My eyes lit up – And as you — I always think — How can I integrate this in Sitecore. And that’s how this blog post came in to this world!

Let’s see how — I have been able to integrate it with Sitecore!

Solution:

You must have observed — Most of the site’s Media Library will have an empty ALT Tag. And it is not easy for someone to go and type such meaningful ALT Tag. Then I thought to use Cognitive Services to suggest us an ALT Tag and based on suggestion set that automatically in ALT Tag field. So, Content Authors/Editors, End users are happy – This is how it works:

I thought to alter his logic of getting ALT Tag instead of substring making an API call and setting it — Sounds easy, right? But my dear friend life is not as easy as it seems to be — After trying this out — I found that there is no way for me to access uploaded file or uploaded media stream — I tried to some options. But with no luck

So, thought to try something else — And I tried item:created, item:saving, item:saved and in each of them I had the same problem. Was unable to get Media Stream

It looks like when these events are getting called — It is creating particular media item and after that BLOB gets attached – I’m assuming this. Have asked Sitecore folks to clarify.

Then finally, Thought to implement : uiUpload – Usually I avoid adding anything to ui* processors. As it will only be handled in UI scenarios and not programmatically scenarios. But I had no option and then I thought of YAGNI principle — I don’t need it now as this is my MVP [Minimum Viable Product]

And here’s all the code you need for that — As I mentioned this is just kind of POC – Key and URL should come from Configuration, Code needs to be ironed out. Before it goes on production — And I will leave it up to you for brevity!

Let’s do our bit to make world better than we found it – Happy Coding!

UPDATE 1 : Thanks Kamruz

After posting this — Kamruz mentioned something similar folks from Community has already done. It looks like I need to sharpen my Google Search Skills – It would have save sometime. But on a +ve side, I have been able to learn and share

Recently I was reading Peopleware — It has the first chapter “Somewhere Today, a Project Is Failing“. – They did research on 500 projects — which they measured on project size, cost, defects, acceleration factors, and success or failure in meeting. Stats are as below:

15 % : Canceled or “postponed” or they delivered products that were never used

25% : For bigger projects, the odds are even worse, they lasted 25 work-years or more failed to complete

In earlier surveys, they discarded these failed data points and analyzed the others. Since 1979, they have been contacting folks who left from projects to find out what went wrong, Most part of the projects they studied, there was not a single technological issue to explain the failure.

I thought to compile similar set of list for Sitecore projects – Because while I’m writing and you are reading – Somewhere Today, a Sitecore Project Is failing.

Before we start would like to mention few things:

Joel’s list is the base class for this list — Because Points which Joel has mentioned applies to any kind of project

Will derive from Joel’s list and jot down my observations specific to Sitecore – It might fit or might not fit for your organization — Please use your own judgement [Listen your team’s views – Analyze – Conclude]. Before you derive something. If you have more better steps — please share

I’m excited to share what I learnt in 8 years, which you might learn in 8 minutes – That’s why I’m born – Born to share – Here we go:

Just a note : These symptoms applies to all kind of projects — Product/New Project/Enhancement and Support Project

Tough to onboard new Developer : If on boarding new developer is taking weeks or people say – No, we can’t onboard new developer new Developer in crunch time without logical reasons and gives you a reason that on boarding will take time from project developers or will take weeks. Then this is a sign of failing Sitecore project. This means everything is unmanaged. No one has documented on boarding steps [They are insecure?!] or current developers configured their Development environment anyhow and now they don’t recall what they did. My rule of thumb is — In 4-6 hours [Vary based on project’s external dependencies e.g. Commerce, SOLR, etc] and a document should be more than enough to onboard new developer. If your teams says No — Take a step back, listen their reasons. And analyze it.

Sitecore Developers don’t know what they are doing : During demo/in meeting, when you ask in-depth “Why” [Is this the best way to do this in Sitecore? Is there a simplified way to do this?] questions and Sitecore Developers can’t explain you in simplified manner — Something is not right. It’s time to get right partner/developer onboard!

Huge Estimates : When you see huge estimates for simple set of tasks, It means that things are not rightly architected If project is new then it’s fine. As building robust framework takes time. But if it is taking longer for later sprints or for support and enhancement – Then you need to talk to your team. Again, It might be a case lead Developer has left and new Developers are trying to understand and implement solution – This is fine to have situation – And each project has a bit of learning curve, As there were no defined Sitecore project architecture standards — It was different company by company or in some cases project by project. And that’s why Sitecore and Sitecore community is excited to learn and implement Helix – You should come out of cave, If you don’t know about Helix and read about it!

You might have smart developers onboard on project. But past implementation has been super tightly coupled, One change can break N number of things or ruin someone’s evening plans or weekend

Developer spends more time in figuring out “What” And “Why” then “How” : Your requirements are super vague. To work on feature A which is in reality 4 hours task. Developer spends 6 hours figuring out all material and still not clear what exactly needs to be done. As soon as he/she knows they are able to complete work in less than 4 hours. Other symptoms are – Team is more busy in meetings than being in zone – Scrum runs for hours and hours, Sprint planning runs for hours and hours, With whole project team. If you hearing <1 Man day task in next day scrum without any blocker — Then something is not right OR Your team is performing less than their capacity/velocity — Then you should talk to team!. Another sign is — If you ask two team members about Project schedule and you hear different answers — It’s time to talk. [Good read — About Watermelon Culture]

Developers don’t have good tools : From my point of view Sitecore Developers must need to have some good tools e.g. Reflector [My personal favorite], TDS Classic, Glass Mapper [If your team is still handy crafting models and not using code generation then they are investing their time in wrong things] etc.

Sitecore Items are not version controlled : This is the biggest sin from my point view. Your Sitecore items are as important as your code [In some cases more than code]. Can you imaging Software industry without version control? I know you tried that in college project[.zip of .zip, final .zip, .backup of .backup :)] — That doesn’t work – We are professionals. You are in to serious business — I like this chapter from 97 things every programmer should know book : http://programmer.97things.oreilly.com/wiki/index.php/The_Professional_Programmer

“Professionals do not make a mess. They take pride in their workmanship. They keep their code clean, well structured, and easy to read. They follow agreed upon standards and best practices. They never, ever rush. Imagine that you are having an out-of-body experience watching a doctor perform open-heart surgery on you. This doctor has a deadline (in the literal sense). He must finish before the heart-lung bypass machine damages too many of your blood cells. How do you want him to behave? Do you want him to behave like the typical software developer, rushing and making a mess? Do you want him to say: “I’ll go back and fix this later?” Or do you want him to hold carefully to his disciplines, taking his time, confident that his approach is the best approach he can reasonably take. Do you want a mess, or professionalism? ”

“We have found TDS Classic easily affords an 8%-15% decrease in costs (time) to develop a Sitecore solution regardless of the size of the project. A 10% savings over 30 weeks for a 3 person team is 9 weeks of gained productivity. If the average team member salary is $75k per year this represents approximately $13k in savings.”

If you have budget constraints? Sitecore community folks have done lot of good things – Especially Kamsar‘s Unicorn

I love Sitecore items to be Version controlled because:

Developers can have their own Sitecore Database copy

Which is blessing when you have Developers who are connecting over VPN to your shared Database — VPN is still not the best solution our industry found

They can make Sitecore level changes without breaking anyone’s challenge

This is the first step for automatic deployment

Everyone is accountable

Easy to track, compare and revert!

Sitecore Configuration Patching is not used : This is also super important to have. Sitecore configuration patching helps you to keep your Sitecore configuration changes in control for development, deployment, troubleshooting and version upgrade. The day your configurations are out of your control — You are done!

Deployment makes your nervous : Obviously, when you say – Live/Production deployment people feel bit nervous. But each time it makes you super nervous and you have a lot of deployment failures/revert – This is sign of some loophole in system. It can be either process, wrong implementation, folks don’t know what they are doing, no/less code reviews, tightly coupled code, QA is not involved in project. Any Developer goes and deploys files in lower environment/in some cases production/live environment. No one takes a lead to take a lead on deployment failure. No one wants to retrospect. I have worked with a team, Where when you say production deployment. They start planning for party — Because they have full confidence on what they have done in their local machine/lower environments, is nothing but a master piece of professional and elegant work! If your deployment is still manual and runs for hours and hours [Think of Web farm with 20+ servers] then you need to stop development and start thinking to automate or semi automate your deployment process OR If you can’t automate please simplify the process. Discourage tame to make last-minute changes or change go live date.

No proper handshaking between teams : I always visualize Sitecore Development – Deployment is same as like Assembly line. If one player/team is slow. It will slow down whole process. [Read The Goal book?]. It’s not because of technology. But no proper team environment. There are teams within teams. UI Developers should always be ahead of Backend developers and QA should be always ahead or aligned with backend developers. QA should be involved in process at right time. I always prefer to have BED and QA work parallelly – Developer writing code and QA writing test cases.

Site performs poor without caching :Sitecore being an enterprise level CMS provides state-of-the art Sitecore caching. But lot of bad implementation tries to hide behind Sitecore caching – I always prefer to do load testing without Sitecore caching. If you can meet your thresholds during this then you will be able to beat your competitors when you go live! Also, It’s always good to have time for performance testing and tuning (Another gold mine is your Sitecore log files – Great Sitecore Developers always prefer to check log files before they Go-Live for Project/Product/Sprint). If your team says – We don’t have time for performance tuning — It’s time to talk!

Content authors need a lot of hand holding or coming up with lot of questions : This means things are not simplified enough or Sitecore’s OOB features are not used e.g. Add Rendering, Placeholder settings, Data source etc.

All plans fail without Content Matrix Plan : If you are ensuring UI, Backend, QA, Servers, DevOps folks, Process everything is good. But in case if you missed to plan, Content management/entry for your huge site — Then your project will get delayed. Because content management is also a critical task. If you have a new site and there is a lot of content your content team should start adding content as soon as they can

Found helpful? I repeat, this is not a fully comprehensive list. I’m sure you will have your learnings which you should share with us — So, you will be able to save that failing project.

Happy Sitecoring!

Filed under: Helix, Sitecore, Tips and Tricks, Tools, Upgrade]]>https://sitecorebasics.wordpress.com/2017/05/30/the-sitecore-basics-test-symptoms-of-failing-sitecore-project/feed/2Reasons-for-Software-Project-Failurekiran Patilhttps://s-media-cache-ak0.pinimg.com/originals/63/e1/34/63e1340fc40edcce7010ce9500937a1e.jpgwhy-helixhttps://www.hash.com/forums/uploads/monthly_06_2007/post-3557-1180792087.jpgHelix, 8.2 DI and An error occurred when trying to create a controller of type ‘ScBasics.Feature.Nav.NavController’. Make sure that the controller has a parameterless public constructorhttps://sitecorebasics.wordpress.com/2017/03/09/helix-8-2-di-and-an-error-occurred-when-trying-to-create-a-controller-of-type-scbasics-feature-nav-navcontroller-make-sure-that-the-controller-has-a-parameterless-public-constructor/
https://sitecorebasics.wordpress.com/2017/03/09/helix-8-2-di-and-an-error-occurred-when-trying-to-create-a-controller-of-type-scbasics-feature-nav-navcontroller-make-sure-that-the-controller-has-a-parameterless-public-constructor/#commentsThu, 09 Mar 2017 03:05:47 +0000http://sitecorebasics.wordpress.com/?p=1332]]>Challenge:

The best part of our lives is, Whatever/However experience you are you will face one exception/error which challenges your experience. And that’s what happened with me recently. And I am sure you agree — That’s when your basics come to rescue — Same was the case in my case.

You might say that’s easy “controller has a parameterless public constructor.” – Just add this and it should work But same code works in local, and second thing is we are using Sitecore 8.2 DI for controllers. And in that case, it is not required to have parameter less public constructor. And if it is same error for you, it means that, your DI is not working.

You are also facing same error? Then this post might help you!

Solution:

So, as every developer on this earth does, We also did a quick Google search and found following links, which were helpful:

Looking at code, it makes sense. But it works in local. But not when deployed. So, after troubleshooting a bit. Thought to log what we get in calling assembly — We also faced challenge here. Sitecore logging will not work at this layer. So, we had to use plain old StreamWriter [You remember, I told. Basics!?]

Above code, uses an alternate method for adding MVC Controllers and best part of this approach is. You no need to register your controllers, which you added in feature project. This foundation project will automatically do it! [BTW, Nothing is automatic, we wrote one time code for it ;-)]

I have been looking at a why, how we can deploy Helix approached solution without adding lot of tools and complexities. After investing some quality time. Have been able to do it. Few tweaks are required to this process. So, it can be automated. But basic idea should get you going!

Solution:

As you know each Foundation/Feature/Project – might have one web project Files which needs to be deployed to webroot. And TDS Items as well. Let’s look at each of them:

Files : To deploy files, I prefered to use my old and gold – Web deploy! As you know for webdeploy and Visual studio publish for web project to work you need .pubxml and it holds few configurations. To centralize those configurations, here’s what we did:

Each Web Project has its own .pubxml file which points to .targets file which we created earlier <Import Project=”..\..\..\..\..\..\Configuration\scbasics-publishsettings.targets” />

So, using above approach, Configurations are centralized. So, in case if you have to change anything. You change it at one place rather than changing lot of places [depends on your feature/foundation/project count]

TDS : We had access of Target server using HTTP. So, we just added required configuration in TdsGlobal.Config for that particular environment. And TDS is smart enough to take care of it! [QUICK UPDATE : 31-AUG-2017 – If you are using TDS Sync over HTTP. Then you can uncheck Build TDS Project for particular build configuration — It will save some time]

I have not been able to hook it with Teamcity and do automated deployment yet. But when I do it using .sln — I can foresee only one challenge — Build ordering – Because your project should be built at last and it should copy root’s Web.Config. But that can be resolved with some ways — Which I’ve left for you! Or you know If I spend time on it, will share with you — I expect the same!

It was Friday evening and it was time to sign off for the day and go on long weekend trip. Just before that we had a task to send a deployment package. And suddenly my friend Vikram shouted — While generating TDS Update package, We are getting this error

TDS: The package builder failed. Please see build output log for more details

When I went to his desk and said – Oh that’s easy. Just look at output log and we should be done! But It’s real world life, which is not as easy as it seems. You are also facing same error? Searching for solution? Then this post is for you:

Solution:

After trying few things we thought to do quick search and we found following great articles:

Both have listed good suggestions. But neither of it worked for us. But might work for you. So, please do it before you move on. What, you already tried and then landed on this post. Then please keep reading. We thought to look at Build log level. By default they are minimal after changing it to Diagnostic. And when we tried again, we were able to find root cause from build output window that one of the .item was corrupted. As such it was not mandatory to have it. So, we deleted it AND It worked!

Hey Friends, I’m excited to share many of first post of 2017! So, far it has been great year and I know a lot of you are MVP now or MVP Again — Congratulations Very well deserved! – Please make sure you help someone else become one — Because sharing is caring — Nice story

Since last year we have been hearing a lot about Habitat and then Helix and lot of people appreciating what Habitat or Helix is. You also heard/read about it? But:

You are afraid of It? Because Habitat solution is huge and you get confused how to set it up. Because it involves a lot of tools to set up e.g. gulp etc. [This is good point to upgrade your web/technology knowledge. It is evolving a lot. All of us accept that FED Technology is seeing lot of huge changes, and .NET Core team is doing super awesome stuff. If you don’t upgrade your self, there are chances of you being dinosaur in this industry]

Confused between Habitat and Helix

You setup your Habitat solution. But when you opened it. You got overwhelmed?

In this process, you don’t know how to get started and what’s the starting path for you to embrace Sitecore Helix?

Then this post is for you — This post will do 95% job to help you getting started on Helix — What about other 5%? — Will share about it before end of this post. So, let’s Helix

Solution:

Before we get further in technical details. Let’s try to understand what is the dictionary meaning of “Helix” – Wiki says “an object having a three-dimensional shape like that of a wire wound uniformly in a single layer around a cylinder or cone, as in a corkscrew or spiral staircase.”

Rather than spending more time — Here I recommend to use VS Task Runner Explorer – It just works!

Once your solution is up and running — Spend time understanding few foundation and feature projects — It will start making sense

This sample project uses Unicorn. But if you are a hard-core TDS Fan and your company embraces TDS — Then you have a great new — TDS team has created TDS repo for this (This is simple to set up and you can also use “Deploy solution” feature of VS which will push all files and Sitecore items, using just a single click) : https://github.com/HedgehogDevelopment/Habitat/tree/TDS

And this also helps you understand how to use TDS with Helix and it works!

Okay, Thank you for those resources. But can you please share your basics with me? So, I can get quickly started. Sure, here we go. I will share my learnings and understandings:

What is difference between Habitat vs Helix?

Helix :

Sitecore® Helix is a set of official guidelines and recommended practices for Sitecore Development.

Set of architecture conventions and guidelines that describe how to apply recommended technical design principles to a Sitecore project.

Secure implementations in a future proof way by architecting them as maintainable and extensible business centric modules

Development process recommendations to make it as easy as possible to build, test, extend, and maintain Sitecore implementations

Habitat :

Habitat is an example project that follows the Helix principles and recommended practices.

PLEASE DON’T USE HABITAT AS FOUNDATION/STARTER KIT FOR YOUR NEW PROJECT – HABITAT IS NOT BUILT FOR THAT

Why we need Helix?

Dependencies : If you look at dependencies, left side-show non helix project — Where any module is talking to any module — And as project becomes huge. No one makes small change with confidence — To make a one line change — Developer/QA/Stakeholders — Have to keep their fingers crossed. And still they have issues and because of it, they either have to miss dinner/lunch/outing with friends/baseball match/cricket match. But when things are done Helix way — right side. There are some standard ways – How each module talks to each other — And that gives everyone full confidence before making any change! — It is simple maths — Invest on strong foundation and take returns in a longer run!

Following diagram, clarifies that — As the project dependencies grow — lot of time spent on coupling rather than feature — and that increase time taken as well!

There are some logical layers defined, and you try to follow it – This image is very self explanatory. You just need to know three things – Foundation, Feature, Project – And each one of them should hold things which suits to their name:

Benefit of using proposed layers — See this example – When you have multiple sites — They can have all foundational and featured things available! – Standard Sitecore Multisite way of doing things:

Helix also guides you how you need to structure your templates – Which are heart of any Sitecore projects :

There are few Helix dependency rules you need to follow — You can break it. But then there is no point in using Helix:

There is a strict reference hierarchy of module categories. Projects -> Features -> Foundations.

Project modules cannot reference other projects, but can reference any Features and Foundations.

Feature modules cannot reference any Project modules or other Feature modules. They can reference Foundations

It seems a lot? I know, I realized after writing. But I wanted to share all our basics with you. Because when we had to start, we were literally struggling to get started. But now, we did it. Thought to share with you. So, it saves some of your time, which you can spend with your loved ones or for other important things!

In Summary,

Helix is not a rocket science, It is same Sitecore code. But how and where you write it — That is standardized by Sitecore — As Sitecore support team is also using same methodology. So, it is easy for them to help you troubleshoot

Just imagine, your company adopts Helix and all projects which your company does, does in Helix [Including your project :-)]. After sometime, any developer can jump from one project to another project – Project on boarding will be super easy — (S)he just need to know business domain. I have seen lot of project leads, don’t allow new developers on board even though they can support more developers in project — Because of project on boarding — Helix helps us all speak same language!

“Helix is like Maths, Once you get it. You enjoy it and would like to do it again and again”

I am sure you must be curious t o know what else 5% I need to do to get 100% knowledge on Sitecore Helix? It’s simple — Get your hands on it. Coding is like swimming. You have to dive in to swim/code!

It was fun to work along with Muktesh and Varun on Helix basics! Thanks to all folks who already wrote about it, which helped us to get it started sooner!

In a small city, there is a company. Where two people work – Mr. Basics and Ms. Curious. As name suggests Ms. Curious was always curious about anything. Whenever she used to see something new, she used to go to his friend. Mr. Basic. Again as name suggests Mr. Basic was always clear with his basics. And when anyone used to come to him with questions. He was helping them understand with all the basic information he had!

Disclaimer — All characters in this publication are entirely fictitious and any resemblance to real persons, living or dead, is purely coincidental.

Also, If you noticed in following posts I used male characters. But knowingly in this story I am adding female character. I would like to encourage more girls to code : https://girlswhocode.com/

So, Ms. Curious came to know about Sitecore Azure which is buzzing since 8.2 update-1 launch and she has already been through few articles on web. But still she prefers to talk to her friend Mr. Basics. So, Mr. basics as always explains all basic details about Sitecore Azure to Ms. Curious. This post shares chat between them. Which you might find helpful. If you are in same boat as Ms. Curious!

Solution:

Read from left to right :

Hope you found this chat helpful! Also, Would like to Thanks to all SC Community members for sharing their learnings as well SC documentation team for nice documentation. Which allowed Mr. basics to simplify Azure learnings. Thank you all of them!

Before you go to last section, Would like to say Thank you (Yes, you!) my dear reader for reading, sharing, visiting, and commenting on my blog. This blog is my open diary. Which I share with you. 2016 had been great year, on our blog — We got 85K views and 15 blog posts. Which makes 167 blog posts overall and 327802 Page views! Thank you – Humble, Grateful!

It is near to midnight in India and my phone is saying me that I should go to sleep. But before I go for sleep. Would like to make sure I blog my learning which took most part of my day and was scrathing my head.

So, I got a new laptop which has Windows 10 on it. Was trying to configure your and mine favorite Sitecore Tool – SIM (If you haven’t heard of Sitecore Instance Manager (SIM) and you are newbie then it’s fine. It is Army knife of Sitecore Developer, and a must need to have tool in your toolset)

After installing was trying to pass through initial configuration and it was tough to pass through following dialog.

In Summary, This seems file system related error. But behind the scenes it also tries to check SQL rights. So, go back and make sure your connection string is right. What I would suggest you to do is. Take that username and password and try to login using SQL Server Management studio and try to create dummy database and delete it using same credentials. This should work. Also, make sure you are running your SQL Service using NETWORK SERVICE account

Also, please make sure you are running SIM as Administrator user

One more thing, Make sure your SIM.EXE is not blocked, as it was downloaded from Web. If so, please unblock it

After doing SQL Server related changes make sure you restart SQL Server – Then only changes will take effect

Then I got busy with other things and thought to find Plan B. Which was installing Plain Sitecore using Sitecore installer. I did that using Sitecore Installer (exe) was able to install Sitecore successfully!

But still that problem was still going on in back of my mind [We are same! ;)]. So, thought to ask few awesome Sitecore developers internally they gave few ideas. But everything was tried. Was about to go to bed and thought to troubleshoot a bit and then go for sleep. And I tried to reproduce the issue. But couldn’t, it was fixed! How?

As per my understanding:

All above mentioned changes

And Installing Sitecore using Sitecore installer

Fixed this issue! I can’t say it confidently. Till I get fresh laptop where I try exact same steps or one of you also try the same and confirm it for us!

Or Alen might have some idea and he improves that error message which indicates exact error message.

After writing above line, I realized that SIM is now open source and Alen and Sitecore’s vision will be fulfilled. If I am able to find this BUG and Fix it or narrow it down. So, I went ahead and cloned repository in my local and have been able to locate code which is causing this behavior. message variable is same for both scenarios – File system and local

And this is what TestSqlServer method does:

After looking at code, I noticed that there has been lot of logging going on. So, thought to find out log file and found it here : C:\Users\<USERNAME>\AppData\Roaming\Sitecore\Sitecore Instance Manager\Logs and found following errors:

Since couple of weeks, Have noticed some performance issues with couple of projects, I was involved. Basically their page load was taking 20 seconds to load and when you look at other things like:

Sitecore log

PublishQueue

History

EventQueue

and so on

Everything seems normal. Then we figured out that we are using MongoSessionStateProvider for these clients and after doing some steps we have been able to load pages in normal load time! So, what we did to tackle the situation? What we learnt during this challenge? Curious to know? We are also curious to share. Here you go:

Solution:

First of all, If Session, SharedSession etc. Confuses you or scares you. Then don’t worry. You are not the only one in this Sitecore world. There are a lot of folks like you. And the best thing is someone already wrote simplified version of it for you – Thanks to Martina! Please read these awesome articles:

Enough Basics. Let’s get back to main point. Live site pages were loading in 20 seconds and as it was slow LB was saying you guys [CD servers] are not healthy. I am not giving you any requests to serve. After doing basic check we thought we should take memory dump and analyze it. Dump revealed that Sitecore is waiting for Mongo to respond. So, we though to look in to Mongo DB and after clearing session collection from session and sharedSession Mongo DB. Things came back to normal.

Then thought to get views on this issue with Sitecore support ticket and during discussion found one BUG and some learnings which says it is good to use SQL Session State Provider instead of Mongo

Support discussion:

Support Team : If you use two different database, the Shared Session State provider might not create a required index on the session collection. As a results, a MongoDB instance can be high overloaded and start producing symptoms like in your case.

Using Robomongo tool, can you please check if there is the e_1__id.s_1__id.a_1 index in the session collection?

The index definition must look like below:

Name: e_1__id.s_1__id.a_1

Keys:

{

“e” : 1,

“_id.s” : 1,

“_id.a” : 1

}

We : We found this index only on session database. It is there in Session and Not Shared Session DB. Do you want us to create it manually?

Support Team :

Yes, you must create the e_1__id.s_1__id.a_1 index to avoid overloads of your MongoDB server. Otherwise, the Sitecore.SessionProvider.MongoDB.MongoSessionStateProvider might put down the server when retrieving contact’s sessions for your web site visitors.

I have registered this issue as a bug in the current version of Sitecore. To track the future status of this bug report, please use the reference number 114604.

Support Team : Sitecore Azure modules has been designed to work with xDB Cloud only. Technically, you can bring your own MongoDB server, Processing/Aggregation, Reporting Services and Search server and plug them in, but you have to do it manually, and then reconfigure Editing Farm as Content Management (CM) role and Delivery Farm as Content Delivery (CD) role. Otherwise, the module deploy configuration from a deployment center as is and a farm will behave as CM/CD/Processing/Aggregation, Reporting Services, which cause many collisions and unpredictable behavior.

Please note Sitecore xDB Cloud it not only MongoDB server. There are many other components with dedicated servers and services. For more information about xDB Cloud please see the xDB Cloud overview article.

We : We’ve already done these steps

Support Team : Sitecore XP product is shipped with Sitecore.SessionProvider.MongoDB.MongoSessionStateProvider and Sitecore.SessionProvider.Sql.SqlSessionStateProvider session state providers. Where first uses MongoDB as session storage and the second one uses SQL Server. You can use either one and there isn’t not specific recommendation, but SqlSessionStateProvider provider might be a bit faster, and most of the customers typically prefer using SQL one in combination of Sitecore Azure + Sitecore xDB Cloud.

> Why does the Sitecore document states that performance enhancements are not supported in Windows Azure, can you elaborate and help us understand why?
The performance optimization that the Performance Boost.sql scrip brings is based on the tempdb, which is not supported by Azure SQL Databases. Therefore, you can’t apply the script and have to remove the CreateTables stored procedure, which relates to the script.

Web Analysis:

During MVP Summit, lot of people said. Good to use SQL Provider instead of Mongo

Good thread : https://community.sitecore.net/developers/f/9/t/118#pi214filter=all&pi214scroll=false “Currently (in SC8), the Session state provider on Mongo is a bit slower than SQL Server (~20%). Apparently this is a thing on the side of the implementation of the session provider itself and it shall be fixed in the upcoming version of Sitecore. The reason for chosing Mongo over SQL is mainly because of simplicity and the characteristic of the session data. You could still use SQL Server with Mongo though.”

” At the moment, I would recommend the sql session provider. I have laerned about some performance issues on certain circumstances with the mongo session provider – so right now, I will recommend sql in any situation.”

Wait for Sitecore to come up with Redis Provider — Which is happening soon. Redis is a winner for Out Proc session storage — Refer Martina‘s article.

But it was not working. I got involved in this project later on. So, had no idea what’s going on. Spent sometime figuring out to make it work. And I think it will be good for you as well to know this. In case, you also face similar issues.

Solution:

We started looking at Solution and found one thing. In past due to Performance issues in experience editor Sitecore folks asked us to disable Sitecore.ContentTesting.Requests.ExperienceEditor.SuggestedTestsCountRequest class to prevent excessive calls to database [Sitecore.ContentTesting.Requests.ExperienceEditor.SuggestedTestsCountRequest class to return 0]. As we were on Sitecore 8.0 Update-2 we had to write our custom code. But it has been fixed in Sitecore 8.0 Update-3 (“The Experience Editor slowed down when there was a large number of Suggested Tests. This has been fixed. (434105)”) after analyzing a bit and having a Sitecore support discussion we thought this seems not be main reason for A/B Testing. But that was theory. Wanted to prove it.

So, Installed plain Sitecore on my local machine and configured Automated Test which was working! Then gradually started adding all configurations and custom code related to A/B testing in plain Sitecore and finally, Have been able to find out root cause. Eager to know? What it is? Let me share

Basically, When we did upgrade we were not using ContentTesting. So, we disabled it using our custom patch file:

ContentTesting.GenerateScreenshots : Determines when screenshots should be generated.Must be one of ( all | limited | none ) Default value: all. Basically, It takes screenshot of all possible variations

This was my second Sitecore event. First one was at Dreamcore Europe in 2011. This one was lot different than last one. Especially, Because of two things:

Sitecore community has grown a lot!

Sitecore is taking this event at a bigger scale – Thanks to their event committee!

So, luckily I was part of this event. Thanks to Horizontal Integration for sponsoring us. 30 people from HI were there. As THIS IS OUR DOMAIN:

It was a great event. Full of information, which will take sometime for me to digest. I took a lot of notes. And I thought to blog and share with you as well. So, If you might have missed this event. Because of any reason – No Visa, Lack of finance, Other plans, Family reasons, or anything else. Then this post is for you.

Again, event was full of experience. And I won’t be able to share same experience with you e.g. We did Go-Karting, Been on boat etc. — That thing I can’t share. But i can surely share knowledge and I am sure you will feel that experience via this article:

Media images

Sitecore MVP Summit : MVP Summit happens every year to appreciate all MVP efforts. Sitecore demonstrates new things first hand to MVPs/VIPs Lot of MVPs and Sitecore employees reached here on Sunday night and they were chatting till early morning Monday — That’s what happens when passionate people gets connected. Monday — It started with registration and Keynote. Followed by lot of sessions. And in evening we went on boat — Awesome experience! Second day we went to NOLA Motorsports — We had sessions there, Round table discussions and finally we did Go-Karting. Few pictures:

Sitecore Symposium : MVP Summit is only for MVPs. But Symposium is for everyone. For Partners – To show their potential and connect with future clients, Developers and Marketing folks to connect with each other, And everyone presents their learnings. This event also started by Welcome reception and registration first day then second day a Keynote from Michael Seifert with a new experience and demand more theme. Followed by back to back sessions and big party at House of Blues. Second day was also full of learnings. Few pictures:

For few projects, I noticed that me and few of my colleagues/friends had issue validating weather Mongo connection is right or not, and if yes whether data is going through or not. Mongo Client tools (e.g. Mongo Management Studio) are there. But what If you can’t install Mongo Client Tool on server and Firewall is blocked to open Mongo connection out of network?

Solution:

This is how it looks :

This is how it works :

Have submitted to Marketplace for review. So, will share link once it is available. But I was eager to share [and I am sure you are eager to use] this with you. Package/Source code/Documentation everything is here : https://klpatil.github.io/SC-82-Demo/

Sitecore is such a huge platform that every day you find something new and interesting. Happens with you as well? It is happening with me since last 7+ years! But I am enjoying learning it and then sharing it with you.

So, let’s say you have one site node defined with all basic things e.g. enablePreview, enableWebEdit, hostName, startItem, database etc. It has hostName as “www.scbasics.com”. Now you would like to have one more site where you would like to use base attributes as earlier defined and you would like to modify few attributes only:

I also did the same and it worked in local. But when I deployed it on QA/Dev server. It was not working. After spending sometime learnt something which I would like to share with you as well. You might see it in future or might be already facing it and reading this blog to find a way! Let’s go!

Solution:

As you would have done, I also did showconfig.aspx on server and then noticed that my site2 was getting added before site1 and that was causing this issue and it was happening because I was using SlowCheetah Transformation and inserting site2 based on environment. To fix it — I used patch:after=”site[@name=’site1′]” which fixed this issue. Here is how it looks new with transformation

Last week one of my mates was trying to configure Web deploy with Build server and CM/CD Server and they were facing some challenges to get it done. We have done it so many times in the past. But as we haven’t had it documented we set together and fixed it. But then I promised to blog it and here you go!

To configure : Refer section : “Configuring a Site for Delegated Non-Administrator Deployment”

That’s it!

You are facing challenge with your Web deploy configuration? Feel free to get in touch with me. Because I have spent good amount of time troubleshooting it (and before that understanding it) and this post is proof of it.

We are near to launch one of our new site. Built on Sitecore 8.1 U1 and MVC, GlassMapper, TDS etc. As per our practice we applied HTML caching on all possible components. Which we were verifying whether it is working as per expectation or not. One of the way to do is using stats.aspx page. But when we opened it. It was displaying only one component — VisitorIdentification — Which is more of a Sitecore control. Then what happened to all our renderings? Same with you? Or you would like to be proactive? And eager to know what it was. Then this post is for you. Let’s delve in to it.

This guy was unable to see his sites, where I was able to see site. But not renderings

Required files were not attached.

Again, as expected. Raised Sitecore support ticket and they accepted it as BUG and provided Hot fix:

To fix the issue, please consider deploying the following patch:1. Copy the attached Sitecore.Support.398176.dll assembly to the ‘\bin’ folder.2. Copy the attached Sitecore.Support.Mvc.Statistics.config file to the ‘\App_Config\Include’ folder.

Before few months back. I started delving in to Sitecore MVC. Before that I knew basics of it. But no hands on. As I was busy with launching other site. Initially when I searched I found the lot of articles and blogs which scared me! You too?! Google can give you results. But which are best and which are not. You can find it out either trying or finding out other folks who already tried and provide good articles. So, while working I took some notes and I promised my self that once I am done I will share with you. So, you may get benefited out of it.

Sounds interesting? You are also searching for something like that? Then go ahead..!

Solution:

As per my practice. I started understanding ASP.NET MVC. Because i always believe in starting from basics. And following links helped me to do so:

I liked following excerpt from Lars – Especially RCMV and this diagram!

MVC stands for Model, View and Controller, though I have never understood the order of the abbreviation (by my limited intellect, RCMV would have been more appropriate, with a Route being a significant part of the equation).

Essentially, the request lifecycle of MVC is a Route (usually something that parses the http request) points to a Control (some .net code) which generates a Model (object), which is parsed by a View (usually a Razor view).

This approach is distinctly different from Web Forms, because it requires more code plumbing to create the page, and with less automated code reuse. On the other hand, the developer has more rigid control of the code executed on the page, and the data delivered to the output. Also, not to forget, MVC makes unit testing easier as (most of/all) the code usually is executed in the controller part of the lifecycle.

Okay, enough theory. I know you developers! We need some action now. So, thought to look for some quick start application tried lot of things. But few things were out dates or not properly documented. Finally Martina’s video helped me to give a hands on. I strongly recommend you to follow exercise given in tutorial. It will give you good hands on experience. Which will boost your confidence and clarify your concepts a lot!

I faced some challenges in quick start. But life is NULL without challenge. And your best learnings come out of a challenging situation only. Here are few blog posts helped me to come out of it:

Howdy friends, Sorry for being away for a while. But was busy with lot of things. I am back here to share my new Sitecore basics with you!

We have been revamping our site on newer Sitecore version. And we are near to launch. Site is already live and we have few sections/pages which are already indexed by Search engines and people might have already bookmarked it. But in new site those pages section has been changed or they have been moved. Sound similar? I guess most sites will have this challenge.

And as you would have done in this case. We also searched for good Sitecore 301 Redirect module. But I have been overwhelmed with lot of results, module and options. But to be honest, we were looking for simple solution which should do following things:

Look for exact source URL and redirect it to either internal item or external URL

Look for pattern and redirect to URL — Might want to preserve querystring

Simple?! You are also looking for same. Then this post is for you! Keep reading..

All redirects resides under: /sitecore/system/Modules/Redirect Module. So, If you have content authors role. Make sure they have access

I faced some issue in my local with SC 8.1 Updated1 – Where for one of the item Response Status — Item’s version was not created. So, If you also face such issue. Please double-check each item and field have versions created

Redirect Pattern: This can be used to group by URLs. When you have source URL request matching some pattern and you would like to redirect on particular item you can use this. As per below example any request coming from any URL having job-posting/job-detail (Pattern : ^/job-postings/job-detail(?<OptionalQueryString>\?.*)?$) in URL should be redirected to Job Detail page with QueyrString (/sitecore/content/SCBasics/Job Search/Job Detail${OptionalQueryString)

It also provides N number folder support. So, It is good practice to follow it!

And If you have a lot of redirects and would like change how redirect item gets resolved (fast, query, api) or would like to change where this module looks for 301 Redirect items then have a look at : SharedSource.RedirectModule.config