Wednesday, 16 May 2018

Takeaway notes from Azure session on Azure SQL databases

How many SQL instances get created based on your Azure subscription? 


Below is the Component which gets created as per your PAAS Subscription.




For E.g I have created the XP0 single instance and we got the below instance. I have masked the data as usual.




How can I allow my IP or IP ranges in order to connect to Azure sql Database?


Choose your sql database and goto  Firewalls and virtual networks and add your IP ranges as shown below.




How can I change the Resource Configuration & Pricing for given Database?

By Default, as highlighted above all the databases are created as "Standard" Option by means of resource Configuration & Pricing.

Choosing a service tier depends primarily on business continuity, storage, and performance requirements.



considering the retention period, we choose basic for CORE database while resting on a standard 


What you mean by DTU?


DTU Stands for Database Throughput Unit (DTU) and it represents a blended measure of CPU, memory, reads, and writes

In the DTU-based purchasing model, customers can choose between Basic, Standard, and Premium service tiers for both single databases and elastic pools.


What you mean by Elastic pool ?


SQL Database elastic pools are a simple, cost-effective solution for managing and scaling multiple databases that have varying and unpredictable usage demands. The databases in an elastic pool are on a single Azure SQL Database server and share a set number of resources at a set price


  • Its cost-effective model
  • No need of over provision
  • No need to worry about individual performance.
  • Individual databases can be configured


Keep Analytics database separate and rest of the database in one elastic pool.

The steps are very simple:
-Create 1 Azure Sql Server
-Create 4 Azure Sql Databases (and import associated Sitecore databases).


-Create 1 Azure Sql Elastic Pool
-Add to pool the 4 Azure Sql Databases





Monday, 14 May 2018

Takeaway notes from Azure session on Deployment Slots

Q: What is Deployment slot?

Image result for Deployment slots



A deployment slot is an additional Azure App Service Web App instance (W3WP) which is ~bound to your production Azure App Service Web App of the same name and runs on the same App Service Plan.

Deployment slots are also known as staged deployment.

A deployment slot will carry the name of the Azure Web App + the name of the slot.
For e.g  If my Azure Web App is called mysite and I create a slot called staging then its url will be

http://mysite-staging.azurewebsites.net

By default, each Azure Web App has a single deployment slot called production which is the Azure Web App itself.

Please note slot is in itself a regular Azure Web App.

Q: Why Deployment slot?


  1. The development slot helps you to test your code prior to the release of the live Web App.
  2. with just a click the new version is live as deployment slot is swapped with the production
  3. Staged Deployment
  4. Autoswap
  5. A/B testing can be executed using different slots

Q: How many deployment slots?


By default, each Azure Web App has a single deployment slot called production which is the Azure Web App itself.

You can add more than one slot as per your business needs.

Q:  How the configuration works between slots.

By default, App Settings and database connection strings are NOT sticky to the slot and will follow the Web App when the test slot is swapped with the production slot.

We need to make the setting sticky to slots so it does not get swapped.

Image result for Deployment slots









Monday, 8 January 2018

Change the Data to "Data to Local Page" for Sitecore SXA Component

By Default when we try to add a data source for given Sitecore SXA Component It opens the "Sitecore.Shell.Applications.Dialogs.SelectRenderingDatasource" dialog as shown below.



Content Authors team request to if we can change the "Data" which create the local data under the context item to "Local data source" for their own ease.

This can be done with just updating the display name of  "Virtual Page Data" item at given path as shown below


/sitecore/system/Settings/Foundation/Experience Accelerator/Local Datasources/Virtual Page Data/__Standard Values
























It works as shown below.












Monday, 13 November 2017

Sitecore Experience Accelerator :: SXA :: Using Page list Component to Display :: Articles Sorted by Custom Date ::

Let's assume that we have a requirement to build the news component which is similar to shown below.




Basic Business Case was to get the news article sorted by their publishing date.

Alright, let's start some action.


  1. All the news items are stored under /sitecore/content/TEN/WEBSITE/Home/news
  2. Create an item query  /sitecore/content/TEN/WEBSITE/Settings/Item Queries/NewsSortedByDate as shown below
I have used build query mechanism 

template:{Your Template Id};sort:news-published-date





Cool now in Page List Component use the item query in order to list the data as shown below.



The index should be updated in order to have relevant and correct data. Default rendering list the data in list view.

We can use rendering variant in order to customize the look and feel as per business need.

Happy Sitecore SXA.







Monday, 30 October 2017

Sitecore Experience Accelerator :: Restrict the Search Result only for Given Template :: Search Result Component

In case you are in love in SXA and using the Search result component in order to display the result.

Here are quick notes before you start.

Fist and foremost you need to Enable the Lucene or  Solr Search configuration so we can go ahead and index the data.

By Default, all the template which inherits from _searchable is getting displayed in  the

search result.




However, we had a requirement to limit for only given template type so only those search result is displayed.


Cool, this can be achieved using SXA in build scope setting as shown below.


Happy Sitecore SXA.

Wednesday, 25 October 2017

How to call the Subscribe Mail Chimp API from C#


I wanted to do MailChimp subscription. I wanted to do using C# so I did a quick google and get Reference of below Code.

Here are the Steps:

Create one Mail Chimp Account and get the API Key 





Get the list ID as shown below;



using System;
using System.IO;
using System.Net;
using Newtonsoft.Json;
using System.Diagnostics;

namespace MailChimpConfiguration
{
    class Program
    {
        static void Main(string[] args)
        {
            var apiKey = "-us17"; // your API key here
            var listId = ""; // your list ID here
            var subscribeRequest = new
            {
                apikey = apiKey,
                id = listId,
                email = new
                {
                    email = "pradsir@gmail.com"
                },
                double_optin = true,
            };
            var requestJson = JsonConvert.SerializeObject(subscribeRequest);



            var responseString = CallMailChimpApi("lists/subscribe.json", requestJson);
            dynamic responseObject = JsonConvert.DeserializeObject(responseString);
            if ((responseObject.email != null) && (responseObject.euid != null))
            {
                // successful!
            }
            else
            {
                string name = responseObject.name;
                if (name == "List_AlreadySubscribed")
                {
                    Trace.TraceInformation("Mailchimp already subscribed");
                }
                else
                {
                    Trace.TraceError("Mailchimp subscribe error {0}", responseObject.error);
                }
            }

        }


        private static string CallMailChimpApi(string method, string requestJson)
        {
            var endpoint = String.Format("https://{0}.api.mailchimp.com/2.0/{1}", "us17", method);
            var wc = new WebClient();
            try
            {
                return wc.UploadString(endpoint, requestJson);
            }
            catch (WebException we)
            {
                using (var sr = new StreamReader(we.Response.GetResponseStream()))
                {
                    return sr.ReadToEnd();
                }
            }
        }
    }
}

Credit :http://markheath.net/post/how-to-call-the-mailchimp-api-from-c 

Tuesday, 5 September 2017

How to install Sitecore Experience accelerator SXA Learning Site "ShowCase"

What is ShowCase for Sitecore Experience Accelerator.?

What Habitat is for Helix; Showcase is for Sitecore Experience Accelerator.

The showcase was originally created by Cognifide for Zen Garden - a product that later evolved into Sitecore Experience Accelerator. And is currently passionately maintained by Adam Najmanowicz

Here are the Steps in order to do Set up for Showcase.


The Latest cut of Showcase can clone or downloaded from Sitecore Showcase





In my case, I have downloaded the same @ C:\projects\Showcase\Sitecore.XA.Showcase




Launch the Visual Studio with Administrative privileges and open the Solution.

Update the showcase folder in Sitecore.XA.Project.Showcase.User.Config depending upon the location you have cloned the Git Solution as shown below.



Rebuild the Solution and Publish the solution to Root of  Sitecore Instance.In my case it was

C:\inetpub\wwwroot\sitecoresxa\Website as shown below



If all goes fine then go to your Sitecore Instance and Login as Admin.

Now goto http://<yourSitecoreinstancename>/unicorn.aspx


Sync in order to install all the Sitecore item.


If all went fine you can see a tenant called showcase and a site called int as shown below


I found some cosmetic issue while accessing in preview mode.




When connnect Sitecore SXA community over Sitecore SXA Slack  Adam replied that the current Git version is not compatible with version 4 and have provided compatible package as given below

https://1drv.ms/u/s!AmgGEEfpMIP2hqBVhOmhFoFGbVzsCg

Voila all fine as shown below




                                                  
Happy Sitecore Experience Acceleration.                        

Featured post

Getting Started With SOLR

Getting Started with Solr ·           Features o    Hit highlighting o    Auto correction o    Faceted Search o    Multi lan...