Skip to content
October 26, 2020 / kiranpatils

Sitecore Azure Real-world Learnings

Challenge

I know you must be thinking, Isn’t it too late to post about this? as Sitecore released support for Docker and everyone is moving towards the container.

I also thought the same, As we’ve been doing Azure PaaS for the last ~3 years. I’ve been fortunate enough to work on various challenging situations for which there is no documentation available on the web.

I’ve been noticing that the Sitecore community is still learning Azure and people have a lot of questions about how Azure PaaS works. While I think the world will move to Docker in a couple of years. But till then existing deployed Azure PaaS solutions will need support as well as there will be few clients who will not be comfortable going with docker till they see Sitecore Community and Industry feedback.

This post should help you resolve your present Sitecore Azure PaaS challenges/questions.

Solution

Basics

If you are new to Azure PaaS, Then I would strongly recommend you go through the Azure 900 Fundamentals course. This course will give you basic knowledge of Azure offerings and this fundamental knowledge will surely help you. This post has explained it nicely: https://tothecore.sk/2020/07/08/microsoft-az-900-azure-fundamentals-exam-study-guide/

For the context of this post, I will not go into the basics of Cloud, Azure PaaS, Sitecore on Azure as I understand the overall community has a good understanding of this. But if you prefer to explain it. Please let me know via comment on this post. And will share basics of Azure PaaS and Sitecore

I’ve divided our learnings in various categories:

Setup

There are various ways you can deploy Sitecore on Azure PaaS.

  1. Marketplace: You can Azure portal to setup environment using Azure Marketplace. This approach is fine for learning and exploring Azure PaaS or for short term needs. For long term and complex needs, we recommend using ARM templates
  2. ARM Templates: As per this approach, you will be able to provision your Azure PaaS environments using ARM Templates. Read more: https://doc.sitecore.com/developers/91/sitecore-experience-manager/en/walkthrough–deploying-a-new-sitecore-environment-to-the-microsoft-azure-app-service.html One thing you have to remember is Sitecore’s ARM Templates: https://github.com/Sitecore/Sitecore-Azure-Quickstart-Templates/ only provision Sitecore roles and not networking components. So, you might need some manual efforts around it.

Reference links:

Quick comparison of IaaS vs PaaS

IaaS WayPaaS Way
Remote desktop to Sitecore ServerAccess Azure Portal
Check logsCheck logs using
– KUDU/Application Editor
– Application Insights
– AzureTools.aspx
Check CPU/MemoryCheck CPU/Memory using KUDU Console
Check Event logsCheck Event logs using – Diagnose and Solve Problems
Generate Memory dumpGenerate dump
– Diagnose and Solve Problems
– KUDU
Restart App PoolRestart app from Portal
Add more hardware resources Upgrade Tier
Make a quick file change– KUDU
– Application Editor
Add new CD ServerScale

Other setup related learnings:

  1. Tiers: As per my experience. This is the place where it needs more planning and research due to the nature of the Azure world – Where things evolve over the night as well as your solution’s complexity and user load.
    1. https://kb.sitecore.net/articles/835916 – Sitecore team has done a good job documenting these and provide those in default ARM Templates. But use them as a base and try to update it as per your need and Azure world updates.
    2. https://azure.microsoft.com/en-us/blog/azure-app-service-premium-tier/ – Standard Tier and Premium tier at the same rate with better hardware!
    3. https://azure.microsoft.com/en-us/updates/announcing-pricing-decrease-for-azure-app-service-on-the-premium-plan/Price reduction of 35%
  2. Elastic pool: OOTB ARM Template doesn’t come with Elastic Pool. But Elastic Pool is the most efficient way to manage your database usage!
    1. https://docs.microsoft.com/en-us/azure/azure-sql/database/elastic-pool-overview
    2. http://blog.baslijten.com/to-elastic-pool-or-not-to-elastic-pool-for-sitecore-on-azure/
  3. Plan your network layer: Before end-users start visiting your awesome site. You need to make sure your app is secure and load balancing is configured. It needs some work. Following are some good resources:
    1. https://doc.sitecore.com/developers/91/sitecore-experience-manager/en/using-azure-application-gateway-to-secure-your-content-delivery-server.html
    2. https://doc.sitecore.com/developers/93/sitecore-experience-manager/en/manage-an-application-gateway.html
    3. https://doc.sitecore.com/developers/91/sitecore-experience-manager/en/create-an-application-gateway.html
    4. https://doc.sitecore.com/developers/91/sitecore-experience-manager/en/azure-waf-and-ase.html
    5. https://suneelsunkara.wordpress.com/2019/01/10/securing-sitecore-deployed-on-azure-web-appspaas-using-application-gatewaywaf-log-analytics-and-azure-monitor/

Once you are done with the above steps. Your site should be ready for the real-world!

But before you do that, Would recommend you go through the following section which talks about performance challenges we faced and it will be good to get those taken care of before you go-live or if you are already live and facing performance issues following section should help you.

Performance and Troubleshooting

  1. Sitecore logs: Where are your Sitecore log files? I’ve seen the majority of people struggling here. There are the following approaches using which you can access your Azure PaaS Sitecore log files:
    1. Application Insights is one way to query log data
    2. https://kb.sitecore.net/articles/911837#AccessingSitecoreLogs – You can also use AzureTools.aspx which is a Client page which queries application insights data [Read more: https://www.sitecoregabe.com/2018/09/azure-paas-sitecore-logs-using-azureailogs.html]
    3. App_Data/logs folder should be able to give you the latest log file. I’ve been using those for my Sitecore 9.3 version. I guess it was not enabled in 9.0.2. Tried to find official information. But was unable to locate it. You can read more about this approach from here: http://sitecore.skowronski.it/sitecore/how-to-get-the-latest-logs-from-azure-with-kudu/
    4. FTP – Personally – I haven’t used this approach. But you can give it a try if you like it!
    5. Good read :
      1. https://jeffdarchuk.com/2019/05/03/dude-wherere-my-logs-azure/
  2. Advanced tools: If the log file is not giving you all information then you might need to use your advanced tools from your armory! Let’s see how you can use those in Sitecore Azure PaaS world:
    1. KUDU is your friend!
    2. Memory/Crash Dump has been my biggest friend for live issue troubleshooting. You can generate a dump using this approach: https://kb.sitecore.net/articles/111669 – Some screenshots are old. But you should be able to figure it out. The initial steps are same.
    3. Application map: If you want to see dependency information getting logged then you should enable application map: https://kb.sitecore.net/articles/201177 – This should be able to help you pinpoint the root cause of an issue.
  3. REDIS timeout: REDIS is critical from a performance point of view. I’ve already shared my learnings on this here: https://sitecorebasics.wordpress.com/2020/02/15/redistimeoutexception-with-sitecore-9-0-2-9-3/
  4. FCN Mode: If your application is crashing and the domain is getting recycled frequently (You can find such information from event logs) then you might be impacted by the FCN issue. Read more about FCN mode here: https://shazwazza.com/post/all-about-aspnet-file-change-notification-fcn/ In Sitecore Media files are stored as a blob in DB and upon the first request, Sitecore creates your media output on the fly and stores it in MediaCache which is filesystem based and if FCN mode is enabled then it will recycle app pool as ASP.NET thinks there are a lot of file system changes happening and app pool should be recycled. It will be good to disable fcnMode in Web.Config. (httpRuntime fcnMode=’Disabled‘). But once you make this change then if you make any quick change in .cshtml or .aspx it won’t be reflected till the next app pool recycle. So, please read more about this before disabling it.
  5. Most important
    1. Stick to basics!
    2. Everything is still Sitecore — So, please apply your older learnings as well e.g. Checking stats.aspx, Event queue etc.

Hope this helps!

Good reads:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: