Monday, June 26, 2017

Get rid of Sitecore trying to set language from URL

Could not parse the language 'XXXX'. Note that a custom language name must be on the form: isoLanguageCode-isoRegionCode-customName. The language codes are two-letter ISO 639-1, and the regions codes are are two-letter ISO 3166. Also, customName must not exceed 8 characters in length. Valid example: en-US-East. For the full list of requirements, see...

If you're getting the following error when loading URLs, and you don't need a language requirement, you can turn off the Sitecore setting in the web.config.

  • Under the "linkManager" sitecore item, set "languageEmbedding" to "never"
  • Under the "Languages.AlwaysStripLanguage" setting, set value to "false"


Wednesday, June 21, 2017

Updating npm and node on Windows

To update npm and node on Windows, follow these steps from a StackOverflow answer:

Run PowerShell as Administrator


Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force

npm install -g npm-windows-upgrade

npm-windows-upgrade



How do I update node and npm on windows?

Thursday, June 15, 2017

Creating a Website in Microsoft Azure with GitHub deployment

Microsoft Azure is a scalable, cloud-based web hosting solution.


Setting up a new Web App


  1. Create a Subscription
    • This is the billing account to use. You can use an existing one or create a new one.
    • To create a new Subscription account, in the Azure portal left sidebar, click on Subscriptions > Add
    • Select the payment account to use
  2. Create a new Web App and App Service Plan
    • The App Service Plan is the container for Web Apps. You can have multiple Web Apps in a single App Service Plan. Plans vary in bandwidth and are priced in tiers.
    • In the left sidebar again, click on App Services > Add
    • Select Web App > Create
      • Fill in App name -- this will be used for your Azure URL on *.azurewebsites.net
      • Select Subscription that you created previously
      • Resource Group can be new, or you can use an existing one if there is one for that App Service
      • App Service Plan: Create new is default, but only use if there isn't one already; otherwise use one that's already there.
      • Click Create and Azure will begin deploying the new site. After 1-2 minutes, you should see an Alert that deployment is complete
      • Now if you go to App Services the new web app will be there. If you select it and click Overview you will see URL, FTP and other info.
  3. Select/Change Service Plan ***Azure will select Standard by default, so you need to manually change it if you want a free/cheaper plan
    • Go to App Services > Scale Up and view the current plan or select a different plan

Setting up a Staging Environment

You can create a separate Web App for staging in the same App Service Plan, or you can create a Deployment Slot in the existing production Web App. Personally I think it is cleaner to use Deployment Slots, to minimize the number of Web Apps. Originally Deployment Slots were meant to be a pre-production environment that you can swap out with the real production environment. For example, you could deploy code changes to the Deployment Slot, then once it's working "Swap" the Deployment Slot and it will immediately update the Production environment. However I think this a different type of workflow than what I usually do with Git and having staging and master branches that deploy to the environments. I don't plan on using the Swap functionality, but many others like using it.


  1. To create a deployment slot, select the App Service and click on Deployment slots > Add Slot
  2. Name it, i.e. "staging" -- this will create a new subdomain on the *.azurewebsites.net site by adding the slot name to the existing Azure domain
  3. Under Configuration Source, select to clone from the existing Web App
  4. Click OK to create the new deployment slot


Setting up GitHub Deployment

At the moment, it's not possible to use an external Git repository for Azure and have staging and master branches that automatically deploy to Azure. GitHub is the suggested method of source control for now. First, create the GitHub repository and the master and staging branches. Once created, go back into Azure to connect the Web App to the repository.

  1. Select the App Service (or App Service's Deployment Slot) > Deployment option
  2. Under Choose Source, select GitHub. You may be prompted to log into GitHub; if so, log in using devservices (Credentials in 1Pass under GitHub)
  3. Select Authorization, Organization, Project, and Branch.
  4. Click OK to create the Deployment option.
  5. Depending on how many files are in the repo, it make take a few minutes or longer to finish building the site. You can check the deployment status under Web App > Deployment options