Sitecore Content Hub Expire Time Settings

ch-logo

Hi Champs,

Today we are going to check two important properties of Sitecore Content Hub which could help you to resolve the issue of getting logged out.

  • ExpireTimeSpan
  • SlidingExpiration

Basically, both properties are part of Authentication within Content Hub Portal Configurations.

ExpireTimeSpan:

This property is as same as session Timeout, but the catch is this works irrespective of activity as this works on authentication cookie.
You can increase the session timeout by setting “ExpireTimeSpan” to any value in minutes up to the upper limit of 1440 minutes, the default value is 30 minutes.

SlidingExpiration:

Set this property to true, then it works whenever a request is done before ExpireTimeSpan which updates the expiration time for the authentication cookie, the default value is false.

Both of these settings should be configured under Manage->Settings->PortalConfiguration->Authentication.

The default value of the setting “SlidingExpiration” is false,

I’ve linked some documentation describing these settings here.

Keep Learning Champs!!!!!

#sitecorecontenthub #sitecorelearn #sitecoremvp #Sitecore #SitecoreMVP #SitecoreCommunity #MVP #learnsitecore #contenthub #contentmarketing #sitecore #sitecorecommunity #developers #sitecoredevelopers #learnsitecore #contenthub

Advertisement

Configuring Related Assets in Sitecore Content Hub

ch-logo

Hi Champs,

It’s been almost a year since I shared something, sorry for that as I was busy with personal things happening.

But now I have decided to share the knowledge back to the community with an innovative mini blog series for Sitecore Content Hub.

The series will have topics like Authentication, Related Assets, Asset Orientation, Notifications flow with Email, Archival flow, etc.

In this blog, we will deep dive into Related Assets from the End user’s point of view where most Content Editors and Administrators want to see the Assets which are Related to each other by some parameters. In our case, we took Location as a parameter and performed this activity.

Here are the detailed steps:

  1. Create a taxonomy Location and add items to it, eg. Pune, Mumbai, etc.
  2. Navigate to Manage > Schema > Asset, and create a taxonomy member to link M.Asset to R.Location (M.Asset is the Child of R.Location).
  3. Create a new group something like “Related Assets Details”.
  4. Add a new taxonomy member to this group and name it something like “RelativeLocation” While creating this on the Advanced tab, make sure Nested is set as true. Save and apply the changes to the Asset definition.
  5. Navigate to Manage > Pages > Asset mass edit table page, and make sure that you add one more column to MassEditTable component to accommodate RelativeLocation member for Asset.
  6. Now Navigate to Manage > Pages > Asset details page, and create a Search component change the setting to show it as a Panel with the title. Use the following filters inside the component:
      • System: Asset (M.Asset)
      • Fixed: Relation (Role: Parent) – RelativeLocation
  1. In the Output Tab of the search, the component set the fields as below.

search-component

  1. Once you create all of this go to the Assets page and select multiple Assets and Edit in Table where you could add the relative locations as below.

asset-mass-edit-table

  1. Go to the Asset details page of an asset. You should see all assets belonging to the same location displayed on the Asset details

related assets

Note:

  • You could create your own Taxonomy relations this is just an example.
  • The restriction is you can add only one filter to this at a time per search component.

To make it easier you can check the following video.

Keep learning champs!!!!!

#sitecorecontenthub #sitecorelearn #sitecoremvp #Sitecore #SitecoreMVP #SitecoreCommunity #MVP #learnsitecore #contenthub #contentmarketing #sitecore #sitecorecommunity #developers #sitecoredevelopers #learnsitecore #contenthub

SSL binding in Azure App Service

Hi Champs,

In part one we discussed how we can add custom domain in Sitecore App Service. Today we will go through how we can secure this custom domain with SSL bindings, so without doing any further delay below are the points to add SSL bindings.

Secure a custom domain

Do the following steps:

In the Azure portal, from the left menu, select App Services > <app-name>.

From the left navigation of your app, start the TLS/SSL Binding dialog by:

  • Selecting Custom domains > Add binding
  • Selecting TLS/SSL settings > Add TLS/SSL binding

Add binding to domain

In Custom Domain, select the custom domain you want to add a binding for.

If your app already has a certificate for the selected custom domain, go to Create binding directly. Otherwise, keep going.

Add a certificate for custom domain

If your app has no certificate for the selected custom domain, then you have two options:

 Note

You can also Create a free certificate (Preview) or Import a Key Vault certificate, but you must do it separately and then return to the TLS/SSL Binding dialog.

Create binding

Use the following table to help you configure the SSL binding in the TLS/SSL Binding dialog, then click Add Binding.

Setting Description
Custom domain The domain name to add the SSL binding for.
Private Certificate Thumbprint The certificate to bind.
TLS/SSL Type
  • SNI SSL – Multiple SNI SSL bindings may be added. This option allows multiple SSL certificates to secure multiple domains on the same IP address. Most modern browsers (including Internet Explorer, Chrome, Firefox, and Opera) support SNI (for more information, see Server Name Indication).
  • IP SSL – Only one IP SSL binding may be added. This option allows only one SSL certificate to secure a dedicated public IP address. After you configure the binding, follow the steps in Remap A record for IP SSL.
    IP SSL is supported only in Production or Isolated tiers.

Once the operation is complete, the custom domain’s SSL state is changed to Secure.

SSL binding successful

 Note

Secure state in the Custom domains means that it is secured with a certificate, but App Service doesn’t check if the certificate is self-signed or expired, for example, which can also cause browsers to show an error or warning.

Remap A record for IP SSL

If you don’t use IP SSL in your app, skip to Test HTTPS for your custom domain.

By default, your app uses a shared public IP address. When you bind a certificate with IP SSL, App Service creates a new, dedicated IP address for your app.

If you mapped an A record to your app, update your domain registry with this new, dedicated IP address.

Your app’s Custom domain page is updated with the new, dedicated IP address. Copy this IP address, then remap the A record to this new IP address.

Test HTTPS

In various browsers, browse to https://<your.custom.domain> to verify that it serves up your app.

Portal navigation to Azure app

How to enable Profiler in Azure App Service

Azure

Hi Champs,

Today I am going to explain how we can enable profiler in Azure App Service. Below are the details to enable Profiler.

Enable Profiler for your app

To enable Profiler for an app, follow the instructions below. If you’re running a different type of Azure service, here are instructions for enabling Profiler on other supported platforms:

Application Insights Profiler is pre-installed as part of the App Services runtime. The steps below will show you how to enable it for your App Service. Follow these steps even if you’ve included the App Insights SDK in your application at build time.

  1. Enable “Always On” setting for your app service. You can update the setting in the Configuration page of your App Service under General Settings.
  2. Go to the App Services pane in the Azure portal.
  3. Navigate to Settings > Application Insights pane.Enable App Insights on App Services portal
  4. Either follow the instructions on the pane to create a new resource or select an existing App Insights resource to monitor your app. Also make sure the Profiler is On. If your Application Insights resource is in a different subscription from your App Service, you can’t use this page to configure Application Insights. You can still do it manually though by creating the necessary app settings manually. The next section contains instructions for manually enabling Profiler.Add App Insights site extension
  5. Profiler is now enabled using an App Services App Setting.App Setting for Profiler

Happy Learning!!!

Performance tuning of Sitecore SPEAK components

Hi Champs,

Today I am going to explain you how you can reduce the time taken for loading by SPEAK components in your Sitecore application.

In order to reduce load time of SPEAK components after website modification, you can alter the compilation element in the web.config by adding the optimizeCompilations attribute to it as follows:

<compilation ...  optimizeCompilations="true">

Actual Implementation in web.config file looks like:

c

Adding this attribute will make ASP.NET re-compile only the files that were explicitly changed and leave all the other files intact.

Please note that if optimizeCompilations is true, you might encounter some issues during development after re-compilation. According to the MSDN article

When you change a top-level file only the affected files are recompiled. This saves time but can cause run-time errors depending on the type of changes you make to a top-level file.

Please check the Optimizing Dynamic Compilation part of the a aforementioned article for more details.

Happy Learning Sitecore !!!!

Excessive usages of threads on session expiration processing in Sitecore

Hi Champs,

Today I am sharing a case study for Excessive usages of threads on session expiration processing in Sitecore 9.2 XP and Sitecore 9.2 XC deployments.

Root cause for the issue:

Due to an issue in Session State providers during high load situations, Sitecore instance may end up in a thread starvation issue which can cause the website to become unresponsive.

Solution to the issue:

Sitecore has provided  SC Hotfix 367157-1.zip hotfix which is recommended to apply to all Sitecore 9.2 XP and Sitecore 9.2 XC deployments.

The patch should be installed on CD instances (or on servers that are dedicated for handling session expiration, if those are a part of a custom setup).

Happy Learning

Azure worker reset module for Sitecore PaaS

Azure

Hi Champs,

Today I am going to introduce my new Module for Sitecore Azure PaaS. This module is called Azure Worker Exchanger details for this are as below.

What is Azure Worker Exchanger?

Azure Worker Exchanger Module is a facility created in association with Microsoft Azure Worker API to kill and replace any of the corrupt or non-performing workers created in Azure PaaS. This module should be used only when any worker process is showing a spike in performance and behaving abnormally or got corrupted, to analyze these below are the symptoms.

  1. Website loading slowly.
  2. Some of the users are not able to visit the website.
  3. Azure is throwing many alerts for performance issues.
  4. Azure matrics showing spikes for performance.

How to use this Module?

  1. Download the Module here.
  2. Install on CM role with Sitecore Package Installer.
  3. Once done you can navigate to the below URL to find the Form.
    https://yourdomain/InstanceExchanger.aspx
  4. Once the form is open you need to supply few details about your Azure Web app. (These are very simple and exactly as mentioned in below photo)
  5. Once you filled the form submit it.
  6. You will get a response message back.
  7. After that wait for 5-10 minutes for Azure to settle everything.
  8. Once everything is settled you need to go to the Azure Web app and open a kudu to see a new worker created with new underlying resources.

Happy Learning !! Keep Learning !!

Check out your CD Solr indexing in Sitecore Azure PaaS Scaled Environment

Hi Champs,

Today I am going to talk on miss-configuration which sometime comes in CD role for Indexing strategy.

There was a scenario which recently I came across that from CD role in Azure PaaS Scaled environment Indexing was getting triggered which is wrong as indexing has to be triggered from CM role ideally. So below are the details of entire case study.

Cloud Environment: Sitecore Managed Cloud (XP-Small and XP-Medium)

Cause of the issue: By default indexing strategy was set to “onPublishEndAsyncSingleInstance” in CD role.

After investigating 10 days with Sitecore support and Product services team we found that indexing strategy was set to “onPublishEndAsyncSingleInstance” which was causing excessive DTU usage. This was set for below.

  1. sitecore_web_index
  2. sitecore_fxm_web_index
  3. sitecore_marketing_asset_index_web
  4. sitecore_marketingdefinitions_web

Solution: I created a patch file for setting indexing strategy to Manual for all above from CD role. As all these are getting rebuild properly from CM role.

Patch file: Patch file has below configurations. Note this has to be added only on CD role.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <contentSearch>
      <configuration>
        <indexes>
          <index id="sitecore_web_index">
            <strategies>
              <strategy>
                <patch:delete />
              </strategy>
              <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual" />
            </strategies>
          </index>
          <index id="sitecore_fxm_web_index">
            <strategies>
              <strategy>
                <patch:delete />
              </strategy>
              <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual" />
            </strategies>
          </index>
          <index id="sitecore_marketing_asset_index_web">
            <strategies>
              <strategy>
                <patch:delete />
              </strategy>
              <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual" />
            </strategies>
          </index>
          <index id="sitecore_marketingdefinitions_web">
            <strategies>
              <strategy>
                <patch:delete />
              </strategy>
              <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual" />
            </strategies>
          </index>
        </indexes>
      </configuration>
    </contentSearch>
  </sitecore>
</configuration>

Happy Indexing

MVC Pre-compiled views in Sitecore 9XP for Azure PaaS

Hi Champs,

Today I am going to explain quick learn for usage of Pre-complied view in Sitecore 9XP. Enabling Pre-compiled MVC views gives boost to performance in Azure PaaS environment, it is considered as one of the performance tuning parameter in  Sitecore Azure PaaS environment and Sitecore Managed Cloud.

By pre-compiling views you will benefit from the following:

  • Compile time checking of errors. Usually, Razor files are compiled when they are first required. By pre-compiling your Razor views you remove the source of runtime bugs.
  • Faster load time. The SitecoreRazorViewEngine will start to load your views from an assembly (.dll file) rather than a view (.cshtml file).
  • Once the Razor-Generator is Configured for your Visual Studio Solution you can follow below steps
  • To enable Razor-Generator Check this link.

Perform the following to pre-compile MVC views:

  1. Go to the below folder path. wwwroot\youewebsitefolder\App_Config\Sitecore\Mvc
  2. Here you will find the config file with the name Sitecore.Mvc.config”
  3. In this file search for term “<precompilation>”.
  4. And under <precompilation> node add below configuration highlighted in green. don’t forget to change the name to your assembly name.                                                                                                       <precompilation>
        <assemblies>
            <assemblyIdentity name=”Sitecore.Mvc” />
            <assemblyIdentity name=”YourAssemblyName” />
        </assemblies>
    </precompilation>

Happy Learning Sitecore !!!!

Disabling ARR’s Instance Affinity in Sitecore Azure Websites

Azure

Hi Champs,

Today I am going to help you in different aspect of scaled environment in Azure where I will explain what is ARR in scaled Sitecore Azure instances. So without delaying we will start this with below pointer which will explain all the things related to this.

What is ARR Affinity?

Application Request Routing (ARR) is a feature where when a client (or browser) request to any Azure based website, a cookie will be created and stick to the first time request received web site instance.

The same cookie will be used for subsequent requests from this client or browser and these requests will be guided to the same web site instance the one which was served for the first time.

Advantages:
With this feature, we can get an advantage if in case the web site instance is maintaining lots of data in it’s memory and moving the subsequent requests to other instance leads to copy entire data to other instance and this is a more performance and pain to the system.

Dis-Advantages:
We can see many disadvantages when compared with advantages. If a client request and unfortunately the sticky instance is not available, this request cannot be guided to any other available instance instead it will send an unavailable message to the client.

Also, In case if an instance is a too much load with other request and this request will be in request queue instead can guide to other instance to balance the load.

How ARR Affinity works?

  1. Client connects to an Azure Web Sites website
  2. ARR runs on the front-end Azure server and receives the request
  3. ARR decides to which of the available instances the request should go
  4. ARR forwards the request to the selected server, crafts and attaches an ARRAffinity cookie to the request
  5. The response comes back to the client, holding the ARRAffinity cookie.
  6. When the client receives the request, it stores the cookie for later use (browsers are designed to do this for cookies they receive from servers)
  7. When the client submits a subsequent request, it includes the cookie in it
  8. When ARR receives the request, it sees the cookie, and decodes it.
  9. The decoded cookie holds the name of the instance that was used earlier, and so ARR forwards the request to the same instance, rather than choosing one from the pool
  10. The same thing (steps 7-9) repeat upon every subsequent request for the same site, until the user closes the browser, at which point the cookie is cleared
8407.blogpicture.png-550x0
 
This is how the affinity cookie looks:
 
5773.bp2.png-550x0
 

Disabling the affinity can be done in different ways: (Every one prefer that last way explained)

  1. In your application
    To control this behavior in an application, you need to write code to send out a special HTTP header, which will tell the Application Request Router to remove the affinity cookie. This header is Arr-Disable-Session-Affinity, and if you set it to true, ARR will strip out the cookie. For example, you could add a line similar to this to your applications’ code: 
     
    headers.Add(“Arr-Disable-Session-Affinity”, “True”);
     
  2. In a site configuration
    If you prefer to have it completely disabled, you could have ARR remove the cookie always by having IIS itself inject that header directly. This is done with a customHeaders configuration section in web.config. Simply add the following into your web.config, and upload it to the root of the site: 

6765.bp3.JPG-550x0 

There is one more way yo disable this is which require us to follow below steps.
  1. Go to Azure App service.
  2.  Then go to Configuration.
  3. In configurations you will find General settings tab click on it.
  4. Here in this tab you will find the Sections called Platform settings.
  5. In this sections you will find the ARR affinity radio button.
  6. As per requirement you can disable it.(by default this is on)

ARR

To test this you need to go into HTTP header and check the value is coming or not. Another simple way is once you disabled it you can clear your browser cookies and load the website again and check in cookies sections and you will find that ARR cookie is not created.

Happy Learning!!!!