Install Headless Services as a Web Deploy Package on Azure

Abstract

Install Sitecore Headless Services on your Azure Sitecore instance

This topic describes how to install Headless Services using a Web Deploy Package (WDP) and ARM templates in an Azure-hosted Sitecore instance.

To install Headless Services with a WDP and with ARM templates:

  1. Download an officially released Sitecore Headless Services WDP matching the version of your rendering SDK version and Sitecore topology.

  2. Download a matching ARM template for your rendering SDK version and topology.

  3. Store both files at a publicly available location, such as Azure storage.

  4. Prepare a file named parameters.json with the content similar to the following:

    {     
        "sqlServerLogin":  
            {"value":  "sql"},
    
        "sqlServerPassword":  
            {"value":  "Password12345"},
    
        "jssMsDeployPackageUrl":
            {"value": "<PackageUrl>"},
    
        "jssCDMsDeployPackageUrl":
            { "value": "<CDPackageUrl>"}
    }
  5. Provision Headless Services using the following script:

    param (
        $DeploymentId = "<deploymentId>",
        $ParametersPath = "<path to parameters file>",
        $SubscriptionName = "<subscription name>",
        $TemplateUri = "<ARM template url>"
    )
    
    Import-Module Az.Accounts
    Import-Module Az.Resources
    
    Connect-AzAccount
    Set-AzContext -SubscriptionName "$SubscriptionName" 
    
    $ModuleName = "JSS" 
    
    # Deployment Name that describes what is supposed to be deployed by this template 
    
    $DeploymentName = "$DeploymentId-$ModuleName" 
    
    New-AzResourceGroupDeployment -Name $DeploymentName -ResourceGroupName $DeploymentId -TemplateUri $TemplateUri -TemplateParameterFile $ParametersPath -Mode Incremental -Verbose
  6. If you are planning to deploy JavaScript applications, configure the Node.js version on Azure to the version you used in development. We recommend using the latest long-term support (LTS) version.

  7. If you are planning to deploy JavaScript applications, to allow Headless Services to create content on the Sitecore instance, you must assign the correct security rights to the sitecore/JSS Import Service Users role:

    • In the content tree, click sitecore, Content.

    • Follow the instructions for assigning access rights specifically to an item and, for the sitecore/JSS Import Service Users role, assign Create rights to items and descendants.