Monday, April 22, 2024

Why Nextjs Sitecore XMCloud application not to be hosted in Azure App Service?

 Problem Statement

Sitecore strongly recommends serverless hosting for XM Cloud, like Vercel or Netlify. Why Nextjs shouldn't be hosted in Azure App Serice? 

The main reason for not recommending Azure App Services is that it takes a server infrastructure approach to hosting, leading to lower performance, difficulty scaling, and higher management complexity.

Lets see them one by one

1. Performance Limitations:

Since Next.js is a JavaScript application and JavaScript is a single-threaded language, the Node.js runtime for JavaScript is also single-threaded. This means that the single-threaded Node server has to handle all requests to your websites, Experience Edge, image optimization, incremental static regeneration, and more, leading to performance issues.

Workaround
PM2 is often suggested as a solution to Node.js performance issues. However, using this tool adds more complexity, and it has not been established whether it improves performance in an XM Cloud front-end hosting solution.


What is PM2?
PM2 is a production process manager for Node.js applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks. 

2. Scalability Limitations

  • Efficient scaling requires a content delivery network (CDN). However, Azure App Services does not come with a CDN by default.
  • Azure does offer the Azure Content Delivery Network service, but you must manage the endpoint and caching. This leads to further increased complexity. This results into higher management complexities.

3. Network Connection Limits

  • A specific limitation of Azure App Services that XM Cloud customers have experienced is the limited network port capacity for outbound network calls. 
  • Customers have hit the network connection limits' upper bounds, leading to severe performance degradation.

Monday, April 15, 2024

Estimation prerequisites for Sitecore Migration and upgrade

 When we planning any sitecore upgrade from lower version such sitecore 8.0+ to sitecore 10+. It is always recommended to understand the dependencies , integration touch points and library.

  • .Net framework vs .Net core any nuget /assembly/library/dll
  • Solr
  • Active Directory
  • SQL server version
  • IIS
  • Federated Login Identity
  • Asp.net mvc if it is mvc project
  • Decide XM vs XP
  • Mongo DB database migration to XConnect
  • Azure Kubernetes require Sitecore v10.3.0

Sitecore Compatability table- XP|XM

https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB0087164

Sitecore Solr Compatability table

https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB0227897

Sitecore MongoDb Compatability table

https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB0633863







Refused to apply style from launchpad.css because its mime type is not supported

If you happen to load sitecore cms and your static content is broken and unable to load static content like js, css and images then it is due to IIS is not enabled with static content.


Refused to apply style from launchpad.css because its mime type is not supported

 

Resolution:
Go to Control Panel > Turn Windows features on or off > Internet Information Services > World Wide Web Services > Common HTTP Features > Static Content. 

Make sure you run IISreset to see the effect.

Saturday, February 17, 2024

A new debugger visualizer for VisualStudio dotnet Entity Framework efcore

A new debugger visualizer for

if you use #dotnet Entity Framework #ef #efcore

Download the extension and see it in action.

 https://marketplace.visualstudio.com/items?itemName=GiorgiDalakishvili.EFCoreVisualizer



Thursday, February 8, 2024

Sitecore XMCloud Local setup docker Cheatsheet

 Make sure you have proper dotnet Core version and nodejs version installed if you planning to setup NextJs with Sitecore XMCloud.


.Net Version is important to run Sitecore CLI where nodejs is mostly for nextjs and other commands .

Initial setup commands

iisreset /stop 

Run .\init.ps1 

.\up.ps1

Troubleshooting

iisreset /stop

./down.ps1

Most common docker command

docker compose up -d

docker compose stop

docker compose down

docker network ls

docker network rm {id of network} mostly this comes handy when _default network settings are already in use




Wednesday, February 7, 2024

Sitecore XMCloud Docker Full Local setup Troubleshooting guide

Scenario #1

XMCloud is setup end to end in local, first time docker and everything spin up and runs fine. Some reason, your system restart and docker container stops. You restarted docker containers and you end up seeing the exceptions below.

Try to run traefik and end up seeing below error notification

Problem

(HTTP code 500) server error - failed to create endpoint sxastarter-traefik-1 on network sxastarter_default: failed during hnsCallRawResponse: hnsCall failed in Win32: The process cannot access the file because it is being used by another process. (0x20)

Resolution

Open command prompt in administrator mode and just run iisreset /stop 


 












Sunday, January 21, 2024

Prompt Engineering generative AI Model Chat GPT

 Effective ways to use Prompt Engineering generative AI model to solve and give you most accurate fact based information . The inputs to AI model is the key. Machine learning algorithm unleash the most significant information that is hidden unless you give a right quest to AI model to mine the right set of data.

  • Creating effective prompt
  • Evaluating prompt performance
  • Using advanced prompt techniques
Tool required : Chat GPT and DALL-E-2 (Is a AI system that generates realistic images and arts from a descriptions in natural language.




What DALL E stands for
ChatGPT
ChatGPT

"DALL-E" is a name that refers to a specific artificial intelligence model developed by OpenAI. The name itself doesn't have a literal meaning or stand for anything. It is named after the famous surrealist artist Salvador Dalí, combined with the name of the Pixar character WALL-E. DALL-E is known for its ability to generate creative and unique images based on textual descriptions




Tuesday, January 9, 2024

Azure B2C Open Id Cookie expiry results in redirect loop on login

Recently we have encountered some unusual behavior when customer tries to login using Azure B2C authentication framework.

Application Type

Web

Technology

 .Net Framework 4.8 Asp.net MVC

CMS

Sitecore CMS 10.0.0

Authentication Framework

Azure B2C
OAuth 2.0 Authorization Code Flow with Proof Key of code Exchange (PKCE)

.Net MSAL Open Id connect


Problem Statement:

User idle for 15 mins and user taken back to Website Sign In page to initiate login again.

Root Cause: Token Exchange Failure. Nonce and Codeverifier expires after 15 mins. User Idle on sign In Page for more than 15mins and post that enters credential and results in login loop.





https://learn.microsoft.com/en-us/azure/active-directory-b2c/authorization-code-flow

Issue reported to Microsoft












Solution: Increase Nonce and Codeverifier expiry timeout.