Sunday, November 26, 2017

Adventures with Sitecore Commerce 8.2.1

Now I'll start by saying I'm am nowhere near the developer skill level of MVPs like  @mike_i_reynolds  or @jammykam or even @ryanbaileynz, but I think I can make a fairly decent job of deploying and configuring Sitecore solutions. Having recently installed Sitecore Commerce 8.2.1 five times in a row I'd thought I'd share some tips for those that are going to have a crack at it for the first time. 

The Steps 


Create a local account


http://commercesdn.sitecore.net/SitecoreCommerce/DeploymentGuide/en-us/index.html#Concepts/c_M_DeploymentCreateLocalAccount.html

 While CSFRuntime user may be ok for development deployments, if you are setting up on a multi-server environment or heading to production, you'll need more granular security accounts to provide an auditable separation of privileges.  This is described here in the Devops guide : 

http://commercesdn.sitecore.net/SitecoreCommerce/DevOpsGuide/en-us/index.html#Concepts/c_M_SitecoreCommerce_Accounts_and_Groups.html

Big important note, these accounts need to installed on a common domain controller across all servers (CM, CD, SQL) 



Install ASP.NET Core and related software



  1. Download and install ASP.NET MVC 4 (available at https://www.asp.net/mvc/mvc4). For more information on MVC, go to Set up Visual Studio to work with Sitecore MVC.
Note: Make sure that the installed version of the .NET Framework is the DevPack/SDK edition, not the Runtime edition. The dotnet publish command used later  will fail if only the Runtime edition is installed.
  1. Download and install .NET Core 1.0.3 SDK Preview 2 build 3156.
No worries 
  1. Download and install .NET Core Windows Server Hosting 1.x.x.
No worries 
  1. Optionally, download and install .NET Core 1.0.1 Visual Studio 2015 Tooling Preview 2. This is only required for a development environment.
  2. Download and install Microsoft Web Deploy 3.6 (the 64 bit file is available at: WebDeploy_amd64_en-US.msi).
No worries
  1. Download and install Microsoft HttpPlatformHandler v1.0 (the 64 bit file is available at httpPlatformHandler_amd64.msi).
No worries 
  1. Restart the server, or open a command prompt and execute the iisreset command to apply the changes to the system path.

Install Sitecore Experience Platform



This should be a no-brainer but careful with this instruction: 

After you have installed Sitecore XP, change the Sitecore web site's application pool identity to .\CSFndRuntimeUser.

If this account does not have database permissions on your Sitecore databases you will run into publishing issues

Also when assigning app pool identities take care here: 

The local account must be prefixed with .\ or MachineName\, otherwise the Initialize-CSSite command (executed later in this workflow) cannot grant proper permissions for Commerce Server databases.

When using a domain controller use the fully qualified domain name i.e. MyDomain\AccountName

Additional Sitecore XP configuration



If you are using a different domain make sure you: 

Change the hostName in Website\App_Config\Include\Reference.Storefront\Reference.Storefront.config

Also remember you have done this, it becomes important later.

Don't forget you'll need a SSL cert, either a domain wildcard or self signed since no one runs on http anymore and certainly not on a commerce site. 



Install Commerce Server



This part contains virtually no tricky bits  and should be a breeze, note the port assignment though 1004

Install Sitecore modules



This is done through the installation wizard and while it may take a while, I had no issues 

Install Sitecore update packages



Again problem free on all installs, clearing the event que on the master database timed out (Azure VM) but everything installed eventually, can take a fair amount of time as well so don't panic.

Also the last package 
  • Sitecore.Reference.Storefront.Powered.by.SitecoreCommerce.10.x.xxx.update
will most likely throw an error when it finishes (see below) - you are safe to ignore it and carry on with your installation, we will fix it later 





Let the Powershell fun begin!!

As long as you fill in the script values correctly this should be easy too, i.e. 

New-CSWebService -Name "CFSolutionStorefrontsite" -Resource Catalog -IISSite "CSServices" -AppPool "CSServices" -Identity 'CSFndRuntimeUser' -Password 'YourPassword'

Update the Commerce Server Profile Schema


Create encryption keys for the CFSolutionStorefrontSite.

This bit is easy, just make sure you run the command in the directory where the ProfileKeyManager.exe

i.e.  C:\Program Files (x86)\Commerce Server 11\Tools

Update the Commerce Server Profile schema by deploying the Commerce Storefront Profile Database DAC package, using the following command. 

This bit is not so easy as it requires permissions on the database to match the username password the process is being run by. Admittedly it was late at night but this one confounded me for a bit. 

The executable  SqlPackage.exe is required and it's location varies depending on your set up so you will have to find it and make sure the path to the .exe, the package and the database server are both correct. 

"C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\SqlPackage.exe" /Action:Publish /SourceFile:".\Database\Profiles\Commerce.Storefront.ProfileDatabase.dacpac" /TargetDatabaseName:CFSolutionStorefrontSite_profiles /TargetServerName:"127.0.0.1" 

In the end I went for jumping onto the SQL server and running it through the command line there. This DACPAC is very important as it sets up the YourStoreName_CommerceProfiles table correctly. 

Also don't be like me and try running it through SQL Management Studio as a Data Tier Update, it will destroy your tables, fortunately years of bumbling my way through things have taught me the value of BACKUP FIRST, BACKUP FIRST BACKUP FIRST !

If you got the error at the end of installing 
  • Sitecore.Reference.Storefront.Powered.by.SitecoreCommerce.10.x.xxx.update
Now is the time to go back to the UpdateInstallationWizard and do it again, no errors this time buddy!


Compile the Commerce Engine




The only trick here is making sure that the installed version of the .NET Framework is the DevPack/SDK edition, not the Runtime edition. The dotnet publish command  will fail if only the Runtime edition is installed.

The publish command will create a folder called Deplopy on you C: Drive which you will copy to the CommerceAuthoring folder specified in your new IIS site. 


Bootstrap and initialize the Commerce Server environment





Now let the fun with JSON configuration files begin

These three commands 


Rely on these JSON files in your commerce authoring site: 

C:\inetpub\CommerceAuthoring\wwwroot\bootstrap\global.json

And all the json files found here: 

C:\inetpub\CommerceAuthoring\wwwroot\data\Environments

Major tip: All the configuration settings must be correct or you will have issues, including but not limited to 

Bad Gateway 

Currency set ‘{4B494292-598E-4A61-A156-D7501F7953ED}’ was not found


Things to check: 

  • Your database strings are correct throughout (Notepad ++ search and replace will save you time) 

 "$type":  "Sitecore.Commerce.Plugin.SQL.EntityStoreSqlPolicy, Sitecore.Commerce.Plugin.SQL",
                                         "TrustedConnection":  true,
                                         "UserName":  "xxxxxx",
                                         "Password":  "XXXXXX",
                                         "Server":  "MACHINENAME\SQLEXPRESS",
                                         "Database":  "SitecoreCommerce_SharedEnvironments",
                                         "AdditionalParameters":  "",
                                         "ConnectTimeout":  120000,
                                         "CleanEnvironmentTimeout":  120000 

  • Your Sitecore admin account settings are correct if you are not using the defaults
  • Your host is correct if you have changed it as mentioned above 


  "$type":  "Sitecore.Commerce.Plugin.Management.SitecoreConnectionPolicy, Sitecore.Commerce.Plugin.Management",
                                         "Host":  "cf.reference.storefront.com",
                                         "SitecoreDatabase":  "master",
                                         "UserName":  "admin",
                                         "Domain":  "sitecore",
                                         "Password":  "b"

Make sure you are thorough with all the JSON files - if either of these fail you will have to go and clear out the  tables before you can run them again. 

DELETE FROM tablename

Also if you do have to run them again, restart the CommerceAuthoring site

Rerun the http://localhost:5000/commerceops/Bootstrap() command to read in any config changes you have made 

Then re run the two commands 


At this stage you should be breathing vast sighs of relief and be as happy as a sand boy

Final configuration



Don't forget to carefully merge the new settings into your web config and watch out for duplicates

Also note one of the merge files is merged into the /Views web.config, I mean you'd have to be half asleep to try and put them anywhere else wouldn't you ....

Reindex the Sitecore and Commerce Server indexes


Check you have sorted your index config before this especially is you are running Solr

Last thoughts 


Bring on Commerce 9 even if it does have JSON configuration , its uses the new Sitecore Installation Framework so it's just going to keep getting easier: 

Sitecore Commerce Server profile definitions not found


http://blog.ryanbailey.co.nz/2017/06/sitecore-commerce-server-profile.html

Sitecore Commerce catalog web service error


http://blog.ryanbailey.co.nz/2017/05/sitecore-commerce-catalog-web-service.html

Also if your Commerce Server Manager wont let you view Profile definitions, make sure that you have added localhost into your trusted sites using IE Internet options, silly old enhanced security !

Sitecore Authorization Manager needs to have your runtime accounts assigned to the administrator roles of the Catalog and Profile web services, usually done as part of the install but can be checked by running azman.msc

If the authorization stores are missing add them from the 2 web services folders

C:\inetpub\CSServices\CFSolutionStorefrontsite_CatalogWebService

CatalogAuthorizationStore.xml

C:\inetpub\CSServices\CFSolutionStorefrontsite_ProfilesWebService

ProfilesAuthorizationStore.xml



Other Resources: 

sitecorechat.slack.com  #ecommerce

Me on Twitter:  @NZsitecore

































Monday, June 19, 2017

The most important image from SUGCON

You may well be asking "why? whats so cool about that image?"

This image popped up in a presentation from the tireless Chris Nash and in one simple picture describes what I still see as the biggest issue with new builds on Sitecore. 

Quite simply, a lot of companies approach a new site with an "it's all about us, the wonderful offerings we have, look how bright and shiny out new site is, showcasing all that you should love about us!!!" 

In the words of Dave Chappelle playing Charlie Murphy .. WRONG!

Here's the image again. 



The image on the left, while functional, is all about the companies brand. The image on the right is all about the customer, designed to remove the irksome half inch of Ketchup (or tomato sauce as we prosaically call it in NZ) left when you get the the end of the bottle, also allowing instant full flow of tomatoey goodness without having to hold the bottle upside down and shake. 

So how does this apply to Sitecore and specifically when it comes time to build that new web presence? 

Same deal, about making it easier for your customer to transact with you, ideally your website should be a tailored smorgasboard of relevant options, for each individual user. This is where its tricky, in a standard site build, the pixel gimps come up with some flash larry designs and the devs then start building it. Pertinent considerations such as personas, profiles, preferences, segments and anticipated behavior so often get swept into the legendary Phase Two. 

The point here is Sitecore provides magnificent tools to allow a true customer-centric approach and my blunt opinion is anyone who purchased Sitecore and is using it only for WCM (admittedly it is damn good at this too) should have probably stuck with Wordpress, sorry for the swearing. 

 So in summary two short messages. 

Design for your customer

Design for UX, customer journey and for what the marketing department knows about your customer, not how you want them to be but how they actually are. 

At the end of the day all that juicy goodness stored in xDB is your biggest tool to increase engagement, reach and conversion. 

Lastly thanks to Chris Nash and if your interested in the amazingness that was SUGCON 2017 - the videos and slides are starting to turn up here: 

http://www.sugcon.eu/sugcon-europe-2016/video-and-downloads/

   


Sunday, June 11, 2017

SUGCON Europe 2017 - But where were the marketers?

You'd be forgiven in thinking that SUGCON 2017 was a geek-fest, in between machine learning, bots, AI, JSS, Commerce and numerous technical sessions, the marketing content took a little bit of digging out. 

The three sessions I did attend, however were all gems in their own right. As I kept pointing out (possibly to my own detriment), all these lovely technical toys are great and all but somehow a bit pointless if you aren't using all this cleverness to personalise and automate etc.


Five Keys to the Successful Context Marketing Project - CHRIS NASH

Christopher Nash has been with Sitecore for almost forever and is a great advocate for the digital marketing side of things. However this one image he popped up spoke so much to what most sites gets wrong, the website is not about "look how wonderful we are" - it should be all about the customer "how we can possibly help you" - have a look below - this one image does say it all. 





Here's Chris with another beautiful message, one CTA is about the brand, one is about the customer. 

Chris also has some great resources available to get you rocking with xDB. Give him a yell. 



Personalizing for Impact -PHIL WICKLUND



 Now Phil normally looks kinda fly so when he turned up looking like a lumberjack I was intrigued. Phil's sessions was practical so the shirt was very appropriate, hopefully his session will turn up in the video and download section here: 


Phil's message was all about transformation, looking beyond the easy tweaks to personalisation that will have a transformational impact across the organisation. 


Master Personalization and Integration - DAVE WALKER




Dave Walker, armed only with the shiniest cape in Amsterdam launches a brave session in the face of the every restless demo gods. 

Check out his slide deck here: 


The video and PPT assets are turning up online here: 


Two Key Takeaways 


  • Its about the customer visiting the site, not about crowing how great your brand is
  • All the cleverness of filling that xDB with mountains of data? well it don't amount to a hill 'o beans unless you are using it to mange and shape experiences. 










Wednesday, May 24, 2017

SUGCON Europe 2017 – Kiwis Can Fly

The SUGCON (Sitecore User Group Conference) is an annual event, managed by the global Sitecore community in association with Sitecore itself. Because it’s a community driven event, organised and attended by passionate Sitecorians from around the world, the topics and sessions tend to be very future-focused, developer centric and a lot less company messaging than one might expect at say symposium.

As a New Zealander, it’s almost exactly halfway round the world to get to Europe, the world being roughly 40,000k round and the trip being 18,000k each way, no small undertaking. The question I got asked most – “well was it worth it?”. The answer is a resounding “hell yes”.

So, let’s start with the highlights, depending on time I’ll try and go into depth around some of these topics in a later post.

Buzzwords of the Event

  • Microservices
  • Machine Learning
  • Zero Deploy
  • Azure PaaS
  • IOT


Robbie The Robot A futuristic showcase of the omni-channel capabilities of Sitecore XP


Admittedly the demo gods didn’t smile that much but Robbie was a big hit. Essentially the lads had wired a Rasberry Pi, Amazon Alexa, Hololens, a camera or two together with a Sitecore instance. Why you may ask? To really demonstrate the future of Sitecore and microservices.

Oh, and to demo it all they picked on a retired developer, Pieter Brinkman who shall be henceforth known as the Brinkmeister for his brilliant contribution to the Sitecore Community.

So, ask Alexa a question, voice recognition translated to a Sitecore request where personalisation kicks in to provide a response. Correct me if I’m wrong but it looks a whole lot like Sitecore is the AI in this scenario and raises the idea that COGNIGY, home to former Sitecore CIO Philipp Heltewig may play a part in this exciting future.


Let’s go one step further and send live video streams to Msoft cognitive services, what comes back is a JSON snippet where multiple faces in the video have been identified and senti-rated, by that I mean rated for emotional content as shown in the returned JSON below.


Did I mention this happens in real time? Even processing a static profile image would provide valuable information about a user that can then be poked into Xdb against a contact and used for further fun. The possibilities, combined with voice recognition and Sitecore personalisation are quite mind boggling if you pause a tic to think about it.

Hedgehog Zero Deploy


More great tools from the folk who brought us TDS and RAZL.

From the creators - “With ZeroDeploy you can finally test code changes without recycling the Sitecore Application Pool reducing overall load time by 99%!! 

How?

ZeroDeploy effectively does a 'hot-swap' of the DLLs in your web application, so the App Pool never recycles, allowing you to see your back-end code changes immediately. No more 60-90 second wait time, while the App Pool reloads.”

Dunno about you but wait for that App pool recycle enough times and it adds up to a lot of down time, especially since it de-zones you, “oh might go and check my email while the app pool recycles – 30 minutes later ooops” – the productivity gains are obvious. 

If you are interested in being a beta tester, sign up here: https://www.teamdevelopmentforsitecore.com/Zero-Deploy-Beta

Publishing Services - What’s new in Publishing Service v2.0

As if the Publishing Services wasn’t already a giant leap, it just got better – it’s enough to say its blindingly fast. As Stephen Pope puts it 

“There are quite a lot of changes between the initial release (1.1) and the next version (2.0) of the Publishing Service that I think people would want to know about. This is the first version that is 100% ready for the cloud and we also did a lot of performance testing and have some great graphs and data to explain all the things we did to further convince them to try out the service”

Other Highlights


  • One click, multi-instance deploys on Azure PaaS
  • Azure Machine Learning
  •  Coveo – building automated search models based on Xdb data
  • Sitecore Commerce, soon to be fully integrated – bye bye Commerce Server.
  • SXA JSON, components that use a Sitecore device to output their content as JSON, hello microservices for anything.
  •  JavaScript Services – Using the React Framework with a few clicks for creation of Sitecore items, supporting personalisation and the Experience Editor – I must admit I was fading a bit during this session but damn it was cool “Ever wondered if you can build full fledged apps in JavaScript and leverage the best out of the Sitecore platform?“ - Alex Shyba and Adam Weber answered this with a definitive YES – also best use of an air cannon to shoot t-shirts into the crowd. 

Roadmap and  Philosophy


Lastly the engaging Jeppe Grue, Sitecore Senior Vice President, Product Strategy closed out with a great overview of the future Sitecore philosophy and roadmap delivered via an appropriate tour of Dutch art and history, what did he promise?

  • ·       Single Update Wizard for any version to latest
  • ·       Brand new UI for the Sitecore client
  • ·       Azure Marketplace and Toolkit
  • ·       The promise of XConnect, the evolution ofthe Data Exchange Framework making it easy to push and transform data from anywhere to anywhere.


Importantly he restated the main reason I got started with Sitecore 10 years ago, it’s fun and cool.

Naturally I couldn’t get to every single session and there is a ton of stuff I did not cover here, but you can have a look at the sessions at the link below.  



In summary, a little sad to be back working a view rendering, but I’m feeling incredibly excited by the future of Sitecore and champing at the bit to apply some of the futuristic stuff to new projects











Tuesday, April 18, 2017

Redirects In Sitecore SXA

Again the wonderful Sitecore support comes to the rescue with details on using the Redirect functionality that is out of the box with Sitecore Experience Accelerator,  until the full documentation is complete I thought I would share this with the community. 


>> If a user goes to our site with a url  like http://sitename/en/our-exports/exporting.aspx  
>> We wish them to be redirected to a sitecore item for example http://sitename/exports 
>> How is this done using the SXA redirect item please? 

You can use the Redirect Map functionality. You need to create a redirect item under /sitecore/content/[Tenant]/[Site]/Settings/Redirects and specify the mapping between URLs:

redirect.png

Important note: the exporting item must not exist. Redirection will be performed only if Sitecore XP can't find a matching item, just before the user is redirected to a 404 page. 


If you want to redirect from existing item, you can use the method described in the article you mentioned. For example, you can insert a redirect item named OldContact, which will redirect to the /Contact page:


redirect_item.png



>> Also does it support wildcards and regex? If so how is this done? 

Redirect Maps support regular expressions. General rule for a regular expression in the redirect mapping: it must start with ^ and end with $. Here is a couple of examples:

This will redirect any request to a page under /products to /anotherpage:
1.png

This example uses tokens:
2.png

Tokens are regex expressions inside parentheses. There are two tokens in the input string above:

  • (.*) - matches any character
  • ([1-9]+) - matches any numeric sequence
These tokens are used in the output string as $1 and $2. Therefore, the request to /products/something/123 will be redirected to /anotherpage/something/123.