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

Advertisement

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 !!!!

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 !!

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!!!!

New/Existing Domain as Custom Domain in Sitecore Managed Cloud

Hi Champs,

As a part of Sitecore Managed Cloud series this one is last article about adding New or Existing domain to SMC app services.

So let’s start directly on article which tells us, how you can migrate the New/existing domain to your SMC Azure App Service as Custom domain.

Enable the CNAME record mapping in Azure

In the left navigation of the app page in the Azure portal, select Custom domains.

Custom domain menu

In the Custom domains page of the app, add the fully qualified custom DNS name (www.contoso.com) to the list.

Select the + icon next to Add custom domain.

Add host name

Type the fully qualified domain name that you added a CNAME record for, such as www.contoso.com.

Select Validate.

The Add custom domain page is shown.

Make sure that Hostname record type is set to CNAME (www.example.com or any subdomain).

Select Add custom domain.

Add DNS name to the app

It might take some time for the new custom domain to be reflected in the app’s Custom domains page. Try refreshing the browser to update the data.

CNAME record added

Note:

After you added custom domain don’t forget to add this domain entry in to sites configurations in SiteDefinition.config or Sitecore.config files.

Happy Learning!!!!

Disaster Recovery in Sitecore Managed Cloud

Hi Champs,

Today I will explain DR or considering High Availability options in Sitecore Managed Cloud. So without doing any delay, we are going to touch straight to the point and start with a process for recovering your data in the event of an outage, incorporating:

  1. Backup technology
  2. Your secondary environment
  3. The steps of the recovery process
  4. Cost
  5. The recovery point objective (RPO)
  6. The recovery time objective (RTO)

Sitecore Managed Cloud offers three different disaster recovery options that differ slightly in cost and specifications, depending on your requirements. The recovery options available are:

  1. HADR Basic
  2. HADR Hot-warm
  3. HADR Hot-hot

Before we go into an explanation of the above three option, I want to explain basic terminologies in the Sitecore high availability disaster recovery (HADR):

  1. High availability (HA) – A system that aims to ensure an agreed level of operational performance. Usually, the uptime is higher than for the normal period, where the system can failover by itself.
  2. Disaster recovery (DR) – An area of business continuity planning that aims to protect an organization from the effects of significant negative events. Disaster recovery allows an organization to maintain or quickly resume mission-critical functions following a disaster that requires manual intervention.

Now I will explain all three options mentioned above, on a high level one by one as below.

HADR Basic:

With HADR basic, the Sitecore Managed Cloud disaster recovery service sets a process into action in the event of an outage. The steps of this process include:

  1. Scheduling a reoccurring backup, that occurs every 3 hours, of the following assets into the secondary database of the recovery point objective (RPO):
    • The databases.
    • Web applications.
    • The connection strings, (for the credentials).
    • The sizes/tiers of the resources.
  2. Arranging an outage page for customers to see while your site is down.
  3. Setting the traffic manager to switch between the primary Content Delivery (CD) server and the outage page.
  4. Setting up email alerts to notify the Managed Cloud Operations team if the availability tests fail.

HADR Hot-warm:

If you are using the HADR hot-warm option, in the event of an outage the Sitecore Managed Cloud disaster recovery service sets the following process into action:

  1. Deploy a new Sitecore environment in the secondary data center and shut down your web applications.
  2. Use active geo-replication to sync the data between the primary and secondary Azure SQL.
  3. Sync the sizes/tiers of all your Azure resources.
  4. Sync the file contents of all of your web applications.
  5. Set up an outage page to ensure your customers are aware that your site is temporarily down.
  6. Set up a traffic manager to switch between the primary Content Delivery (CD) server and the outage page.
  7. Set up email alerts to notify the Managed Cloud Operations team whenever an availability test fails.

HADR Hot-hot:

In the event of an outage, with the HADR hot-hot option, you must set into motion a recovery a process that is similar to the following:

  1. Enable recovery during a disaster by setting up the necessary environment before the disaster happens.
  2. Initiate the backup and replication process so that the Sitecore deployment and data are available for a healthy recovery.
  3. Deploy a passive Sitecore solution into the secondary region.
  4. Set up and enable the traffic manager to be the public gateway.

Prerequisites:

To set up your disaster recovery process:

  1. Ensure you are running your Sitecore solution (9.1 or later), on Azure.
  2. Install PowerShell with an Azure SDK, version 6.0.0 or later.
  3. Run your setup script and use the relevant modules.
  4. Use PowerShell (AzureRM), to log in to Azure and select the relevant subscription.
  5. Have your Sitecore license file ready.
  6. Have any scripts that you want to develop for your HADR hot-hot scenario ready.
  7. Use the Sitecore Azure Toolkit.

Note:

  1. Sitecore supports the following topologies: XM and XP, and the following deployment sizes: Extra Small, Small, Medium, Large, Extra Large.
  2. You can also use Simple Azure PaaS DR management to create DR of your SMC instances.

Reference:

https://doc.sitecore.com/developers/91/sitecore-experience-manager/en/high-availability-disaster-recovery–hadr-.html

Happy Learning !!!!

Deploying to Sitecore Managed Cloud

Hi Champs,

As part of of Sitecore Managed Cloud blog series this my last blog for how to deploy to Sitecore Managed Cloud.

Without any further delay I will start with option which we have to deploy to SMC.

  1. Sitecore Azure Toolkit (SAT).
  2. Use Azure DevOps with TDS and Razl.

Sitecore Azure Toolkit (SAT):

To deploy your Sitecore solution onto Microsoft Azure®. The Sitecore Azure Toolkit simplifies the task of preparing and deploying a Sitecore solution with:

  • PowerShell commandlets to package a Sitecore instance into role-specific packages.
  • Default integration with Microsoft Azure services: Microsoft Azure SQL®, Microsoft Azure Redis Cache, Microsoft Application Insights®, Microsoft Azure Cognitive Search®.
  • Prebuilt ARM templates for frequently used topologies: XM, XP, XPSingle.
  • Configuration tweaks to run Sitecore on the Azure App Service.
  • Security features: HTTPS, low-privileged SQL access, secure Sitecore password.

Click here for more documentation for  getting started with Sitecore Azure Toolkit.

Use Azure DevOps with TDS and Razl:

There is another way which can be used is Configuring CI-CD pipelines in Azure DevOps by Using TDS web deploy packages. And for migrating the database use a Razl for first time. Let me explain this to you steps by step.

  1. Once you get SMC environments to use, you need to raise a ticket to Sitecore support for providing a services contract details for Azure DevOps which you are using.
  2. Once you get those details you need to configure that in your Azure DevOps account.
  3. Once Above is done you can use TDS to build and create web deploy packages pipeline.
  4. Once build pipeline is created then you can go further and create a release pipeline for the same.
  5. Now once entire setup is done you can have two option for getting your content (Sitecore data) migrated. The simple way is to sync everything to TDS and deploy, and the best way(recommended) is that use Razl to Sync all data for first time and then in subsequent release sync only required Sitecore data to TDS.

Summary: I found two ways to deploy the solution on SMC, but there are many different ways to do this. Please let me know in comment the other ways you guys used for deploying Sitecore on SMC.

Note: For using Razl please click here for link where great way described by Jon Jones.

Happy Learning!!!!

Capacity Management in Sitecore Managed Cloud

Hi Champs,

As out Sitecore Managed Cloud, series is going on. So I decided to get you guys a new informative blog for Capacity Management in Sitecore Managed Cloud and, without any due we will start this.

Following are some point which you as Customer or Partner needs to take care of in case of Capacity Management or Sizing in SMC.

  • Budget.
  • The size of your Content database
  • The size of your xDB database
  • Cache sizing
  • Your Search Engine implementation plan
  • Your disaster recovery plan
  • Your RPO and RTO in the event of an outage
  • Any Previous sizing references.

Role of Customer/Partner:

As a Customer or Partner, you can also share more and more analytics reports of your exiting application or forecast analysis of users and their behavior and application requirements with respect to infrastructure in Azure. As all this information will give the technical team a way to design a constructive way to implement your needs. 

You also need to specify special needs like if you want to integrate some services for log management(Sumo Logic), APMT(New Relic). because these can take extra storage, app services or databases.

Role of Sitecore Team:

Once you as Customer or Partner provides some prerequisite information from above at the time of availing this service, Sitecore Cloud Ops team will choose the tier accordingly and then give you vanilla instances of SMC. Once that is done then according to your Capacity plan which will be based on the rest of the remaining above point will be executed jointly as per roles and responsibilities decided.

Note: You always have to scale your capacities as all this is Azure PaaS based.

Happy Learning!!!!

Role and Responsibilities in Sitecore Managed Cloud

Hi Champs,

As per last blog of this series of Sitecore Manged Cloud concept we will start next topic which is Roles and Responsibilities in working with Sitecore Managed Cloud. Below are the roles involved in implementation of Sitecore Managed Cloud.

  1. Sitecore
  2. Sitecore Partner
  3. Sitecore Customer

Now we will straight away move to responsibilities of each role in different streams.

Sitecore(Sales and Cloud Ops team):

once Sitecore sales team on-board you with below process there most of the work is done and and the only Cloud Ops team is the major contact point for you as Customer or Partner.

End-to-end

After setting up everything for you(Customer or Partner) access is given and then you(Customer or Partner) need to deploy your solution to the Sitecore Managed Cloud environment. There are few other responsibilities like below.

  1. Infrastructure Monitoring.
  2. Application Security.
  3. Proactive Infra incident notifications.
  4. Web app firewall configurations.
  5. Web app scale up process.
  6. Database backup service.
  7. Initial SSL configurations.
  8. Actions on infra suggestion.
  9. Security incident management.
  10. Activation and termination of cloud service .
  11. Billing.
  12. Process monitoring.

Sitecore Partner/Customer:

Sitecore Partner/Customer has many responsibilities like below.

  1. Deploy Solution on Sitecore Managed Cloud.
  2. Network: NSG and Firewall setup.
  3. Third party service connectivity.
  4. SSL configurations.
  5. Sitecore platform hotfix management.
  6. Custom domain setup.
  7. Sitecore version upgrade.
  8. Performance optimization

There are so many other responisiblities are there in this process for Customers/Partner and Sitecore, I have listed only the major ones. you can learn more at Sitecore Managed Cloud doc.

Hope above will help you, I will be continuing posting article for this series.

Happy learning.