Skip to content

Instantly share code, notes, and snippets.

@jermdavis
Last active November 23, 2021 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jermdavis/989cdec72ede2824012d81ce8610ed37 to your computer and use it in GitHub Desktop.
Save jermdavis/989cdec72ede2824012d81ce8610ed37 to your computer and use it in GitHub Desktop.
Installing Solr for Sitecore v9.1 using SIF's createcert.json - Blog post explaining this at: https://blog.jermdavis.dev/posts/2019/a-second-attempt-at-installing-solr-with-sif
##
## private functions
##
#
# If necessary, download a file and unzip it to the specified location
#
function downloadAndUnzipIfRequired
{
Param(
[string]$toolName,
[string]$toolFolder,
[string]$toolZip,
[string]$toolSourceFile,
[string]$installRoot
)
if(!(Test-Path -Path $toolFolder))
{
if(!(Test-Path -Path $toolZip))
{
Write-Information -Message $toolSourceFile -Tag "Downloading $toolName"
if($pscmdlet.ShouldProcess("$toolSourceFile", "Download source file"))
{
Start-BitsTransfer -Source $toolSourceFile -Destination $toolZip
}
}
else
{
Write-Information -Message $toolZip -Tag "$toolName already downloaded"
}
Write-Information -Message $targetFile -Tag "Extracting $toolName"
if($pscmdlet.ShouldProcess("$toolZip", "Extract archive file"))
{
Expand-Archive $toolZip -DestinationPath $installRoot -Force
}
}
else
{
Write-Information -Message $toolFolder -Tag "$toolName folder already exists - skipping"
}
}
#
# Update the Solr configuration with the changes for HTTP access
#
function configureHTTP
{
Param(
[string]$solrHost,
[string]$solrRoot
)
$solrConfig = "$solrRoot\bin\solr.in.cmd"
if(!(Test-Path -Path "$solrConfig.old"))
{
if($pscmdlet.ShouldProcess("$solrConfig", "Rewriting Solr config file HTTP"))
{
$cfg = Get-Content $solrConfig
Rename-Item $solrConfig "$solrConfig.old"
$newCfg = $newCfg | % { $_ -replace "REM set SOLR_HOST=192.168.1.1", "set SOLR_HOST=$solrHost" }
$newCfg | Set-Content $solrConfig
}
Write-Information -Message "$solrConfig" -Tag "Solr config updated for HTTP access"
}
else
{
Write-Information -Message "$solrConfig" -Tag "Solr config already updated for HTTP access - skipping"
}
}
#
# Update the Solr configuration with the changes for HTTPS access
#
function configureHTTPS
{
Param(
[string]$solrHost,
[string]$solrRoot,
[string]$certStore,
[string]$CertificatePassword
)
$solrConfig = "$solrRoot\bin\solr.in.cmd"
if(!(Test-Path -Path "$solrConfig.old"))
{
if($pscmdlet.ShouldProcess("$solrConfig", "Rewriting Solr config file for HTTPS"))
{
$cfg = Get-Content $solrConfig
Rename-Item $solrConfig "$solrRoot\bin\solr.in.cmd.old"
$newCfg = $cfg | % { $_ -replace "REM set SOLR_SSL_KEY_STORE=etc/solr-ssl.keystore.jks", "set SOLR_SSL_KEY_STORE=$certStore" }
$newCfg = $newCfg | % { $_ -replace "REM set SOLR_SSL_KEY_STORE_PASSWORD=secret", "set SOLR_SSL_KEY_STORE_PASSWORD=$CertificatePassword" }
$newCfg = $newCfg | % { $_ -replace "REM set SOLR_SSL_TRUST_STORE=etc/solr-ssl.keystore.jks", "set SOLR_SSL_TRUST_STORE=$certStore" }
$newCfg = $newCfg | % { $_ -replace "REM set SOLR_SSL_TRUST_STORE_PASSWORD=secret", "set SOLR_SSL_TRUST_STORE_PASSWORD=$CertificatePassword" }
$newCfg = $newCfg | % { $_ -replace "REM set SOLR_HOST=192.168.1.1", "set SOLR_HOST=$solrHost" }
$newCfg | Set-Content $solrConfig
}
Write-Information -Message "$solrConfig" -Tag "Solr config updated for HTTPS access"
}
else
{
Write-Information -Message "$solrConfig" -Tag "Solr config already updated for HTTPS access - skipping"
}
}
##
## Exported functions
##
#
# Download and unzip the appropriate version of NSSM if it's not already in place
#
function Invoke-EnsureNSSMTask
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true)]
[string]$downloadFolder,
[parameter(Mandatory=$true)]
[string]$nssmVersion,
[parameter(Mandatory=$true)]
[string]$nssmSourcePackage,
[parameter(Mandatory=$true)]
[string]$installFolder
)
PROCESS
{
$targetFile = "$installFolder\nssm-$nssmVersion"
$nssmZip = "$downloadFolder\nssm-$nssmVersion.zip"
Write-Information -Message "$nssmVersion" -Tag "Ensuring NSSM installed"
downloadAndUnzipIfRequired "NSSM" $targetFile $nssmZip $nssmSourcePackage $installFolder
}
}
#
# Download and unzip the appropriate version of Solr if it's not already in place
#
function Invoke-EnsureSolrTask
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true)]
[string]$downloadFolder,
[parameter(Mandatory=$true)]
[string]$solrVersion,
[parameter(Mandatory=$true)]
[string]$solrSourcePackage,
[parameter(Mandatory=$true)]
[string]$installFolder
)
PROCESS
{
$targetFile = "$installFolder\solr-$solrVersion"
$solrZip = "$downloadFolder\solr-$solrVersion.zip"
Write-Information -Message "$solrVersion" -Tag "Ensuring Solr installed"
downloadAndUnzipIfRequired "Solr" $targetFile $solrZip $solrSourcePackage $installFolder
}
}
#
# Update the JAVA_HOME environment variable if required
#
function Invoke-EnsureJavaHomeTask
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true)]
[string]$jrePath
)
PROCESS
{
$jreVal = [Environment]::GetEnvironmentVariable("JAVA_HOME", [EnvironmentVariableTarget]::Machine)
if($jreVal -ne $jrePath)
{
Write-Information -Message "$jrePath" -Tag "Ensuring JAVA_HOME environment variable set"
Write-Host "Setting JAVA_HOME environment variable"
if($pscmdlet.ShouldProcess("$jrePath", "Setting JAVA_HOME environment variable"))
{
[Environment]::SetEnvironmentVariable("JAVA_HOME", $jrePath, [EnvironmentVariableTarget]::Machine)
}
}
else
{
Write-Information -Message "$jrePath" -Tag "JAVA_HOME environment variable already set - skipping"
}
}
}
#
# Make sure that the solr host name exists in the hosts file
#
function Invoke-EnsureHostNameTask
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true)]
[string]$solrHost
)
PROCESS
{
$hostFileName = "c:\\windows\system32\drivers\etc\hosts"
$hostFile = [System.Io.File]::ReadAllText($hostFileName)
if(!($hostFile -like "*$solrHost*"))
{
Write-Information -Message "$solrHost" -Tag "Adding host entry"
if($pscmdlet.ShouldProcess("$solrHost", "Configure host file entry"))
{
"`r`n127.0.0.1`t$solrHost" | Add-Content $hostFileName
}
}
else
{
Write-Information -Message "$solrHost" -Tag "Host entry already set - skipping"
}
}
}
#
# Process the configuration changes necessary for Solr to run
#
function Invoke-ConfigureSolrTask
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true)]
[bool]$solrSSL,
[parameter(Mandatory=$true)]
[string]$solrHost,
[parameter(Mandatory=$true)]
[string]$solrRoot,
[parameter(Mandatory=$true)]
[string]$certificateStore,
[parameter(Mandatory=$true)]
[string]$CertificatePassword
)
PROCESS
{
if($solrSSL)
{
Write-Information -Message "HTTPS" -Tag "Configuring Solr for HTTPS access"
configureHTTPS $solrHost $solrRoot $certificateStore $CertificatePassword
}
else
{
Write-Information -Message "HTTP" -Tag "Configuring Solr for HTTP access"
configureHTTP $solrHost $solrRoot
}
}
}
#
# Ensure that a trusted SSL Certificate exists for the Solr host name, and export it for Solr to use
#
function Invoke-EnsureSSLCertificateTask
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true)]
[bool]$solrSSL,
[parameter(Mandatory=$true)]
[string]$solrName,
[parameter(Mandatory=$true)]
[string]$solrHost,
[parameter(Mandatory=$true)]
[string]$certificateStore,
[parameter(Mandatory=$true)]
[string]$sourceCert
)
PROCESS
{
if($solrSSL)
{
Write-Information -Message "$sourceCert" -Tag "Copying the site cert to $certificateStore"
copy $sourceCert $certificateStore
}
}
}
#
# Ensure that a service exists to run the specified version of Solr
#
function Invoke-EnsureSolrServiceTask
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true)]
[string]$solrName,
[parameter(Mandatory=$true)]
[string]$installFolder,
[parameter(Mandatory=$true)]
[string]$nssmVersion,
[parameter(Mandatory=$true)]
[string]$solrRoot,
[parameter(Mandatory=$true)]
[string]$solrPort
)
PROCESS
{
$svc = Get-Service "$solrName" -ErrorAction SilentlyContinue
if(!($svc))
{
Write-Information -Message "$solrName" -Tag "Installing Solr service"
if($pscmdlet.ShouldProcess("$solrName", "Install Solr service using NSSM"))
{
&"$installFolder\nssm-$nssmVersion\win64\nssm.exe" install "$solrName" "$solrRoot\bin\solr.cmd" "-f" "-p $solrPort"
}
$svc = Get-Service "$solrName" -ErrorAction SilentlyContinue
}
else
{
Write-Information -Message "$solrName" -Tag "Solr service already installed - skipping"
}
if($svc.Status -ne "Running")
{
Write-Information -Message "$solrName" -Tag "Starting Solr service"
if($pscmdlet.ShouldProcess("$solrName", "Starting Solr service"))
{
Start-Service "$solrName"
}
}
else
{
Write-Information -Message "$solrName" -Tag "Solr service already started - skipping"
}
}
}
#
# Verify Solr is working by opening a browser to the admin UI.
#
function Confirm-SolrInstallTask
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true)]
[bool]$solrSSL,
[parameter(Mandatory=$true)]
[string]$solrHost,
[parameter(Mandatory=$true)]
[string]$solrPort
)
PROCESS
{
$protocol = "http"
if($solrSSL -eq $true)
{
$protocol = "https"
}
$url = "$($protocol)://$($solrHost):$solrPort/solr/"
Write-Information -Message "$url" -Tag "Verifying Solr is running"
if($pscmdlet.ShouldProcess("$url", "Open Solr in default browser to verify it"))
{
Invoke-Expression "start $url"
}
}
}
Register-SitecoreInstallExtension -Command Invoke-EnsureNSSMTask -As EnsureNssm -Type Task
Register-SitecoreInstallExtension -Command Invoke-EnsureSolrTask -As EnsureSolr -Type Task
Register-SitecoreInstallExtension -Command Invoke-EnsureJavaHomeTask -As EnsureJavaHome -Type Task
Register-SitecoreInstallExtension -Command Invoke-EnsureHostNameTask -As EnsureHostName -Type Task
Register-SitecoreInstallExtension -Command Invoke-ConfigureSolrTask -As ConfigureSolr -Type Task
Register-SitecoreInstallExtension -Command Invoke-EnsureSSLCertificateTask -As EnsureSSLCertificate -Type Task
Register-SitecoreInstallExtension -Command Invoke-EnsureSolrServiceTask -As EnsureSolrService -Type Task
Register-SitecoreInstallExtension -Command Confirm-SolrInstallTask -As SolrInstall -Type Task
{
"Parameters" : {
"JREVersion": {
"Type": "string",
"DefaultValue": "1.8.0_202",
"Description": "What version of the Java Runtime should "
},
"SolrVersion": {
"Type": "string",
"DefaultValue": "7.2.1",
"Description": "What version of Solr should be downloaded for install"
},
"NSSMVersion": {
"Type": "string",
"DefaultValue": "2.24",
"Description": "What version of NSSM should be downloaded for install"
},
"InstallFolder": {
"Type": "string",
"DefaultValue": "c:\\solr",
"Description": "Where should Solr and NSSM be installed to"
},
"DownloadFolder": {
"Type": "string",
"DefaultValue": "~\\Downloads",
"Description": "Where should downloaded files be placed"
},
"SolrUseSSL": {
"Type": "boolean",
"DefaultValue": true,
"Description": "Should Solr require HTTPS for access?"
},
"SolrHost": {
"Type": "string",
"DefaultValue": "solr",
"Description": "What host name should the Solr service use"
},
"SolrPort": {
"Type": "string",
"DefaultValue": "8983",
"Description": "The port the Solr service should use"
},
"CertFilePath": {
"Type": "string",
"DefaultValue": "c:\\certificates\\",
"Description": "Where certificates got exported to after generation"
},
"ProgFilesFolder": {
"Type": "string",
"DefaultValue": "C:\\Program Files",
"Description": "Where certificates got exported to after generation"
},
"CertificatePassword": {
"Type": "string",
"DefaultValue": "SIF-Default",
"Description": "The password set on the certificate"
}
},
"Modules" : [
"SolrInstall-SIF-Extension.psm1"
],
"Variables" : {
"NSSMSourcePackage": "[concat('https://nssm.cc/release/nssm-', parameter('NSSMVersion'), '.zip')]",
"SolrSourcePackage": "[concat('https://archive.apache.org/dist/lucene/solr/', parameter('SolrVersion'), '/solr-', parameter('SolrVersion'), '.zip')]",
"JREPath": "[concat(parameter('ProgFilesFolder'), '\\Java\\jre', parameter('JREVersion'))]",
"SolrInstallFolder": "[concat(parameter('InstallFolder'), '\\solr-', parameter('SolrVersion'))]",
"SolrName": "[concat('solr-', parameter('SolrVersion'))]",
"CertStoreFile": "[concat(variable('SolrInstallFolder'), '\\server\\etc\\solr-ssl.keystore.pfx')]",
"SourceCert": "[concat(parameter('CertFilePath'), parameter('SolrHost'), '.pfx')]"
},
"Tasks" : {
"Ensure NSSM is installed": {
"Type": "EnsureNSSM",
"Params": {
"downloadFolder": "[parameter('DownloadFolder')]",
"nssmVersion": "[parameter('NSSMVersion')]",
"installFolder": "[parameter('InstallFolder')]",
"nssmSourcePackage": "[variable('NSSMSourcePackage')]"
}
},
"Ensure Solr is installed": {
"Type": "EnsureSolr",
"Params": {
"downloadFolder": "[parameter('DownloadFolder')]",
"solrVersion": "[parameter('SolrVersion')]",
"installFolder": "[parameter('InstallFolder')]",
"solrSourcePackage": "[variable('SolrSourcePackage')]"
}
},
"Ensure Java_Home environent variable is set": {
"Type": "EnsureJavaHome",
"Params": {
"jrePath": "[variable('JREPath')]"
}
},
"Ensure host name exists": {
"Type": "EnsureHostName",
"Params": {
"solrHost": "[parameter('SolrHost')]"
}
},
"Rewrite Solr config file": {
"Type": "ConfigureSolr",
"Params": {
"solrSSL": "[parameter('SolrUseSSL')]",
"solrHost": "[parameter('SolrHost')]",
"solrRoot": "[variable('SolrInstallFolder')]",
"certificateStore": "[variable('CertStoreFile')]",
"CertificatePassword": "[parameter('CertificatePassword')]"
}
},
"Ensure trusted SSL certificate exists (if required)": {
"Type": "EnsureSSLCertificate",
"Params": {
"solrSSL": "[parameter('SolrUseSSL')]",
"solrName": "[variable('SolrName')]",
"solrHost": "[parameter('SolrHost')]",
"certificateStore": "[variable('CertStoreFile')]",
"sourceCert": "[variable('SourceCert')]"
}
},
"Ensure Solr runs as a service": {
"Type": "EnsureSolrService",
"Params": {
"solrName": "[variable('SolrName')]",
"installFolder": "[parameter('InstallFolder')]",
"nssmVersion": "[parameter('NSSMVersion')]",
"solrRoot": "[variable('SolrInstallFolder')]",
"solrPort": "[parameter('SolrPort')]"
}
},
"Verify Solr is working": {
"Type": "SolrInstall",
"Params": {
"solrSSL": "[parameter('SolrUseSSL')]",
"solrHost": "[parameter('SolrHost')]",
"solrPort": "[parameter('SolrPort')]"
}
}
}
}
{
"Parameters": {
"XConnectCertificateName": {
"Type": "String",
"Description": "The name of the certificate to be created for the xconnect server.",
"DefaultValue": ""
},
"IdentityServerCertificateName": {
"Type": "String",
"Description": "The name of the certificate to be created for the identity server.",
"DefaultValue": ""
},
"IdentityServerSiteName": {
"Type": "String",
"Description": "The name of the identity server to be created.",
"DefaultValue": "IdentityServer"
},
"LicenseFile": {
"Type": "String",
"Description": "The path to the Sitecore license file.",
"DefaultValue": ".\\License.xml"
},
"Prefix": {
"Type": "String",
"DefaultValue": "SC910",
"Description": "The prefix for uniquely identifying instances."
},
"SitecoreAdminPassword": {
"Type": "string",
"DefaultValue": "SIF-Default",
"Description": "The admin password for the Sitecore instance."
},
"SqlAdminUser": {
"Type": "string",
"DefaultValue": "sa",
"Description": "The Sql admin user account to use when installing databases."
},
"SqlAdminPassword": {
"Type": "string",
"DefaultValue": "12345",
"Description": "The Sql admin password to use when installing databases."
},
"SQLServer": {
"Type": "String",
"DefaultValue": "Localhost",
"Description": "The Sql Server where databases will be installed."
},
"SqlCollectionPassword": {
"Type": "string",
"DefaultValue": "SIF-Default",
"Description": "The Sql admin password to use when installing databases."
},
"SqlProcessingPoolsPassword": {
"Type": "string",
"DefaultValue": "SIF-Default",
"Description": "The Sql password for the Processing Pools connection string in Sitecore."
},
"SqlReferenceDataPassword": {
"Type": "string",
"DefaultValue": "SIF-Default",
"Description": "The Sql password for the Reference Data connection string in Sitecore."
},
"SqlMarketingAutomationPassword": {
"Type": "string",
"DefaultValue": "SIF-Default",
"Description": "The Sql password for the Marketing Automation connection string in Sitecore."
},
"SqlMessagingPassword": {
"Type": "string",
"DefaultValue": "SIF-Default",
"Description": "The Sql password for the Messaging connection string in Sitecore."
},
"SqlProcessingEnginePassword": {
"Type": "string",
"DefaultValue": "SIF-Default",
"Description": "The Sql password for the Processing Engine Tasks and Storage database connection strings in Sitecore."
},
"SqlReportingPassword": {
"Type": "string",
"DefaultValue": "SIF-Default",
"Description": "The Sql password for the Reporting connection string in Sitecore."
},
"SqlCorePassword": {
"Type": "string",
"DefaultValue": "SIF-Default",
"Description": "The Sql password for the Core connection string in Sitecore."
},
"SqlSecurityPassword": {
"Type": "string",
"DefaultValue": "SIF-Default",
"Description": "The Sql password for the Security connection string in Sitecore."
},
"SqlMasterPassword": {
"Type": "string",
"DefaultValue": "SIF-Default",
"Description": "The Sql password for the Master connection string in Sitecore."
},
"SqlWebPassword": {
"Type": "string",
"DefaultValue": "SIF-Default",
"Description": "The Sql password for the Web connection string in Sitecore."
},
"SqlProcessingTasksPassword": {
"Type": "string",
"DefaultValue": "SIF-Default",
"Description": "The Sql password for the Processing Tasks connection string in Sitecore."
},
"SqlFormsPassword": {
"Type": "string",
"DefaultValue": "SIF-Default",
"Description": "The Sql password for the Experience Forms connection string in Sitecore."
},
"SqlExmMasterPassword": {
"Type": "string",
"DefaultValue": "SIF-Default",
"Description": "The Sql password for the EXM Master connection string in Sitecore."
},
"SolrHost": {
"Type": "String",
"DefaultValue": "localhost",
"Description": "The Solr host name to use."
},
"SolrUrl": {
"Type": "String",
"DefaultValue": "https://localhost:8983/solr",
"Description": "The Solr instance to use."
},
"SolrRoot": {
"Type": "String",
"DefaultValue": "C:\\solr\\solr-7.2.1",
"Description": "The file path to the Solr instance."
},
"SolrService": {
"Type": "String",
"DefaultValue": "Solr-7.2.1",
"Description": "The name of the Solr service."
},
"XConnectPackage": {
"Type": "String",
"DefaultValue": "",
"Description": "The path to the XConnect package to deploy."
},
"XConnectSiteName": {
"Type": "String",
"DefaultValue": "XConnect",
"Description": "The name of the XConnect site."
},
"SitecoreSiteName": {
"Type": "String",
"DefaultValue": "Sitecore",
"Description": "The name of the Sitecore site."
},
"PasswordRecoveryUrl": {
"Type": "string",
"Description": "Password recovery Url (Host name of CM instance).",
"DefaultValue": "http:\\"
},
"SitecorePackage": {
"Type": "String",
"DefaultValue": "",
"Description": "The path to the Sitecore package to deploy."
},
"IdentityServerPackage": {
"Type": "String",
"DefaultValue": "",
"Description": "The path to the Identity Server package to deploy."
},
"XConnectCollectionService": {
"Type": "string",
"DefaultValue": "https://XConnect",
"Description": "The url for the XConnect Collection Service."
},
"ClientsConfiguration": {
"Type": "string",
"DefaultValue": "",
"Description": "Sitecore IdentityServer clients configuration"
},
"AllowedCorsOrigins": {
"Type": "string",
"Description": "Pipe-separated list of instances (URIs) that are allowed to login via Sitecore Identity.",
"DefaultValue": ""
},
"SitecoreIdentityAuthority": {
"Type": "string",
"DefaultValue": "https://SitecoreIdentityServerHost",
"Description": "IdentityServer provider URI."
},
"ClientSecret": {
"Type": "string",
"Description": "Client secret of PasswordClient section. It's a random string between 1 and 100 symbols long.",
"DefaultValue": "SIF-Default"
},
"MachineLearningServerUrl": {
"Type": "string",
"DefaultValue": "",
"Description": "The Microsoft Machine Learning Server instance to use."
},
"MachineLearningServerBlobEndpointCertificatePath": {
"Type": "string",
"DefaultValue": "",
"Description": "The Machine Learning Server Blob Storage WebApi Endpoint Certificate Path."
},
"MachineLearningServerBlobEndpointCertificatePassword": {
"Type": "string",
"DefaultValue": "",
"Description": "The Machine Learning Server Blob Storage WebApi Endpoint Certificate Password."
},
"MachineLearningServerTableEndpointCertificatePath": {
"Type": "string",
"DefaultValue": "",
"Description": "The Machine Learning Server Table Storage WebApi Endpoint Certificate Path."
},
"MachineLearningServerTableEndpointCertificatePassword": {
"Type": "string",
"DefaultValue": "",
"Description": "The Machine Learning Server Table Storage WebApi Endpoint Certificate Password."
},
"MachineLearningServerEndpointCertificationAuthorityCertificatePath": {
"Type": "string",
"DefaultValue": "",
"Description": "The path to certificate of certification authority that issued certificates for Machine Learning Server Blob and Table storage endpoints."
},
"XConnectXP0:Package": {
"Type": "String",
"Reference": "XConnectPackage",
"Description": "Override to pass XConnectPackage value to XConnectXP0 config."
},
"SitecoreXP0:Package": {
"Type": "String",
"Reference": "SitecorePackage",
"Description": "Override to pass SitecorePackage value to SitecoreXP0 config."
},
"IdentityServer:Package": {
"Type": "String",
"Reference": "IdentityServerPackage",
"Description": "Override to pass IdentityServerPackage value to IdentityServer config."
},
"XConnectXP0:Sitename": {
"Type": "String",
"Reference": "XConnectSiteName",
"Description": "Override to pass XConnectSiteName value to XConnectXP0 config."
},
"SitecoreXP0:Sitename": {
"Type": "String",
"Reference": "SitecoreSiteName",
"Description": "Override to pass SitecoreSiteName value to SitecoreXP0 config."
},
"IdentityServer:PasswordRecoveryUrl": {
"Type": "String",
"Reference": "PasswordRecoveryUrl",
"Description": "Override to pass PasswordRecoveryUrl value to IdentityServer config."
},
"SitecoreXP0:SitecoreIdentityAuthority": {
"Type": "String",
"Reference": "SitecoreIdentityAuthority",
"Description": "Override to pass SitecoreIdentityAuthority value to SitecoreXP0 config."
},
"SitecoreXP0:XConnectCollectionService": {
"Type": "String",
"Reference": "XConnectCollectionService",
"Description": "Override to pass XConnectCollectionService value to SitecoreXP0 config."
},
"IdentityServer:ClientsConfiguration": {
"Type": "String",
"Reference": "ClientsConfiguration",
"Description": "Override to pass ClientsConfiguration value to IdentityServer config."
},
"XConnectXP0:SqlServer": {
"Type": "String",
"Reference": "SQLServer",
"Description": "Override to pass SqlServer value to XConnectXP0 config."
},
"SitecoreXP0:SqlServer": {
"Type": "String",
"Reference": "SQLServer",
"Description": "Override to pass SqlServer value to SitecoreXP0 config."
},
"IdentityServer:SqlServer": {
"Type": "String",
"Reference": "SQLServer",
"Description": "Override to pass SqlServer value to IdentityServer config."
},
"XConnectSolr:SolrUrl": {
"Type": "String",
"Reference": "SolrUrl",
"Description": "Override to pass SolrURL value to XConnectSolr config."
},
"XConnectXP0:SolrURL": {
"Type": "String",
"Reference": "SolrUrl",
"Description": "Override to pass SolrURL value to XConnectXP0 config."
},
"SitecoreSolr:SolrUrl": {
"Type": "String",
"Reference": "SolrUrl",
"Description": "Override to pass SolrURL value to SitecoreSolr config."
},
"SitecoreXP0:SolrUrl": {
"Type": "String",
"Reference": "SolrUrl",
"Description": "Override to pass SolrURL value to SitecoreXP0 config."
},
"XConnectSolr:SolrRoot": {
"Type": "String",
"Reference": "SolrRoot",
"Description": "Override to pass SolrRoot value to XConnectSolr config."
},
"SitecoreSolr:SolrRoot": {
"Type": "String",
"Reference": "SolrRoot",
"Description": "Override to pass SolrRoot value to SitecoreSolr config."
},
"XConnectSolr:SolrService": {
"Type": "String",
"Reference": "SolrService",
"Description": "Override to pass SolrService value to XConnectSolr config."
},
"SitecoreSolr:SolrService": {
"Type": "String",
"Reference": "SolrService",
"Description": "Override to pass SolrService value to SitecoreSolr config."
},
"XConnectSolr:CorePrefix": {
"Type": "String",
"Reference": "Prefix",
"Description": "Override to pass Prefix value to XConnectSolr config."
},
"XConnectXP0:SqlDbPrefix": {
"Type": "String",
"Reference": "Prefix",
"Description": "Override to pass Prefix value to XConnectXP0 config."
},
"XConnectXP0:SolrCorePrefix": {
"Type": "String",
"Reference": "Prefix",
"Description": "Override to pass Prefix value to XConnectXP0 config."
},
"SitecoreSolr:CorePrefix": {
"Type": "String",
"Reference": "Prefix",
"Description": "Override to pass Prefix value to SitecoreSolr config."
},
"SitecoreXP0:SqlDbPrefix": {
"Type": "String",
"Reference": "Prefix",
"Description": "Override to pass Prefix value to SitecoreXP0 config."
},
"IdentityServer:SqlDbPrefix": {
"Type": "String",
"Reference": "Prefix",
"Description": "Override to pass Prefix value to IdentityServer config."
},
"SitecoreXP0:SolrCorePrefix": {
"Type": "String",
"Reference": "Prefix",
"Description": "Override to pass Prefix value to SitecoreXP0 config."
},
"XConnectCertificates:CertificateName": {
"Type": "String",
"Reference": "XConnectCertificateName",
"Description": "Override to pass XConnectCertificateName value to XConnectCertificates config."
},
"IdentityServerCertificates:CertificateName": {
"Type": "String",
"Reference": "IdentityServerCertificateName",
"Description": "Override to pass IdentityServerCertificateName value to IdentityServerCertificates config."
},
"IdentityServer:SiteName": {
"Type": "String",
"Reference": "IdentityServerSiteName",
"Description": "Override to pass IdentityServerSiteName value to IdentityServer config."
},
"IdentityServer:SitecoreIdentityCert": {
"Type": "String",
"Reference": "IdentityServerCertificateName",
"Description": "Override to pass IdentityServerCertificateName value to IdentityServer config."
},
"XConnectXP0:XConnectCert": {
"Type": "String",
"Reference": "XConnectCertificateName",
"Description": "Override to pass CertificateName value to XConnectXP0 config."
},
"SitecoreXP0:XConnectCert": {
"Type": "String",
"Reference": "XConnectCertificateName",
"Description": "Override to pass CertificateName value to SitecoreXP0 config."
},
"XConnectXP0:LicenseFile": {
"Type": "String",
"Reference": "LicenseFile",
"Description": "Override to pass LicenseFile value to XConnectXP0 config."
},
"SitecoreXP0:LicenseFile": {
"Type": "String",
"Reference": "LicenseFile",
"Description": "Override to pass LicenseFile value to SitecoreXP0 config."
},
"IdentityServer:LicenseFile": {
"Type": "String",
"Reference": "LicenseFile",
"Description": "Override to pass LicenseFile value to IdentityServer config."
},
"XConnectXP0:SqlAdminUser": {
"Type": "String",
"Reference": "SqlAdminUser",
"Description": "Override to pass SqlAdminUser value to XConnectXP0 config."
},
"SitecoreXP0:SqlAdminUser": {
"Type": "String",
"Reference": "SqlAdminUser",
"Description": "Override to pass SqlAdminUser value to SitecoreXP0 config."
},
"XConnectXP0:SqlAdminPassword": {
"Type": "String",
"Reference": "SqlAdminPassword",
"Description": "Override to pass SqlAdminPassword value to XConnectXP0 config."
},
"SitecoreXP0:SqlAdminPassword": {
"Type": "String",
"Reference": "SqlAdminPassword",
"Description": "Override to pass SqlAdminPassword value to SitecoreXP0 config."
},
"IdentityServer:AllowedCorsOrigins": {
"Type": "String",
"Reference": "AllowedCorsOrigins",
"Description": "Override to pass AllowedCorsOrigins value to IdentityServer config."
},
"XConnectXP0:MachineLearningServerUrl": {
"Type": "String",
"Reference": "MachineLearningServerUrl",
"Description": "Override to pass MachineLearningServerUrl value to XConnectXP0 config."
},
"XConnectXP0:MachineLearningServerBlobEndpointCertificatePath": {
"Type": "String",
"Reference": "MachineLearningServerBlobEndpointCertificatePath",
"Description": "Override to pass MachineLearningServerBlobEndpointCertificatePath value to XConnectXP0 config."
},
"XConnectXP0:MachineLearningServerBlobEndpointCertificatePassword": {
"Type": "String",
"Reference": "MachineLearningServerBlobEndpointCertificatePassword",
"Description": "Override to pass MachineLearningServerBlobEndpointCertificatePassword value to XConnectXP0 config."
},
"XConnectXP0:MachineLearningServerTableEndpointCertificatePath": {
"Type": "String",
"Reference": "MachineLearningServerTableEndpointCertificatePath",
"Description": "Override to pass MachineLearningServerTableEndpointCertificatePath value to XConnectXP0 config."
},
"XConnectXP0:MachineLearningServerTableEndpointCertificatePassword": {
"Type": "String",
"Reference": "MachineLearningServerTableEndpointCertificatePassword",
"Description": "Override to pass MachineLearningServerTableEndpointCertificatePassword value to XConnectXP0 config."
},
"XConnectXP0:MachineLearningServerEndpointCertificationAuthorityCertificatePath": {
"Type": "String",
"Reference": "MachineLearningServerEndpointCertificationAuthorityCertificatePath",
"Description": "Override to pass MachineLearningServerEndpointCertificationAuthorityCertificatePath value to XConnectXP0 config."
},
"SolrCertificates:CertificateName": {
"Type": "String",
"Reference": "SolrHost",
"Description": "Override to pass SolrCertificateName value to SolrCertificates config."
},
"SolrExportPassword": {
"Type": "String",
"DefaultValue": "testpassword",
"Description": "Password to export the solr cert with."
},
"SolrCertificates:ExportPassword": {
"Type": "String",
"Reference": "SolrExportPassword",
"Description": "Password to export the solr cert with."
},
"Solr:CertificatePassword": {
"Type": "String",
"Reference": "SolrExportPassword",
"Description": "Password the solr cert was exported with."
},
"CertPath": {
"Type": "String",
"DefaultValue": "c:\\certificates",
"Description": "where exported certs go"
}
},
"Variables": {
"SqlProcessingPools.Password": "[if(variable('Test.SqlProcessingPools.Password'),variable('Generate.SqlProcessingPools.Password'),parameter('SqlProcessingPoolsPassword'))]",
"XConnectXP0:SqlProcessingPools.Password": "[variable('SqlProcessingPools.Password')]",
"SitecoreXP0:SqlProcessingPools.Password": "[variable('SqlProcessingPools.Password')]",
"Test.SqlProcessingPools.Password": "[equal(parameter('SqlProcessingPoolsPassword'),'SIF-Default')]",
"Generate.SqlProcessingPools.Password": "[randomstring(Length:20,DisAllowSpecial:True,EnforceComplexity:True)]",
"SqlCollection.Password": "[if(variable('Test.SqlCollection.Password'),variable('Generate.SqlCollection.Password'),parameter('SqlCollectionPassword'))]",
"XConnectXP0:SqlCollection.Password": "[variable('SqlCollection.Password')]",
"Test.SqlCollection.Password": "[equal(parameter('SqlCollectionPassword'),'SIF-Default')]",
"Generate.SqlCollection.Password": "[randomstring(Length:20,DisAllowSpecial:True,EnforceComplexity:True)]",
"SqlReferenceData.Password": "[if(variable('Test.SqlReferenceData.Password'),variable('Generate.SqlReferenceData.Password'),parameter('SqlReferenceDataPassword'))]",
"XConnectXP0:SqlReferenceData.Password": "[variable('SqlReferenceData.Password')]",
"SitecoreXP0:SqlReferenceData.Password": "[variable('SqlReferenceData.Password')]",
"Test.SqlReferenceData.Password": "[equal(parameter('SqlReferenceDataPassword'),'SIF-Default')]",
"Generate.SqlReferenceData.Password": "[randomstring(Length:20,DisAllowSpecial:True,EnforceComplexity:True)]",
"SqlMarketingAutomation.Password": "[if(variable('Test.SqlMarketingAutomation.Password'),variable('Generate.SqlMarketingAutomation.Password'),parameter('SqlMarketingAutomationPassword'))]",
"XConnectXP0:SqlMarketingAutomation.Password": "[variable('SqlMarketingAutomation.Password')]",
"SitecoreXP0:SqlMarketingAutomation.Password": "[variable('SqlMarketingAutomation.Password')]",
"Test.SqlMarketingAutomation.Password": "[equal(parameter('SqlMarketingAutomationPassword'),'SIF-Default')]",
"Generate.SqlMarketingAutomation.Password": "[randomstring(Length:20,DisAllowSpecial:True,EnforceComplexity:True)]",
"SqlMessaging.Password": "[if(variable('Test.SqlMessaging.Password'),variable('Generate.SqlMessaging.Password'),parameter('SqlMessagingPassword'))]",
"XConnectXP0:SqlMessaging.Password": "[variable('SqlMessaging.Password')]",
"SitecoreXP0:SqlMessaging.Password": "[variable('SqlMessaging.Password')]",
"Test.SqlMessaging.Password": "[equal(parameter('SqlMessagingPassword'),'SIF-Default')]",
"Generate.SqlMessaging.Password": "[randomstring(Length:20,DisAllowSpecial:True,EnforceComplexity:True)]",
"SqlProcessingEngine.Password": "[if(variable('Test.SqlProcessingEngine.Password'),variable('Generate.SqlProcessingEngine.Password'),parameter('SqlProcessingEnginePassword'))]",
"XConnectXP0:SqlProcessingEngine.Password": "[variable('SqlProcessingEngine.Password')]",
"Test.SqlProcessingEngine.Password": "[equal(parameter('SqlProcessingEnginePassword'),'SIF-Default')]",
"Generate.SqlProcessingEngine.Password": "[randomstring(Length:20,DisAllowSpecial:True,EnforceComplexity:True)]",
"SqlReporting.Password": "[if(variable('Test.SqlReporting.Password'),variable('Generate.SqlReporting.Password'),parameter('SqlReportingPassword'))]",
"XConnectXP0:SqlReporting.Password": "[variable('SqlReporting.Password')]",
"SitecoreXP0:SqlReporting.Password": "[variable('SqlReporting.Password')]",
"Test.SqlReporting.Password": "[equal(parameter('SqlReportingPassword'),'SIF-Default')]",
"Generate.SqlReporting.Password": "[randomstring(Length:20,DisAllowSpecial:True,EnforceComplexity:True)]",
"SqlCore.Password": "[if(variable('Test.SqlCore.Password'),variable('Generate.SqlCore.Password'),parameter('SqlCorePassword'))]",
"SitecoreXP0:SqlCore.Password": "[variable('SqlCore.Password')]",
"IdentityServer:SqlCore.Password": "[variable('SqlCore.Password')]",
"Test.SqlCore.Password": "[equal(parameter('SqlCorePassword'),'SIF-Default')]",
"Generate.SqlCore.Password": "[randomstring(Length:20,DisAllowSpecial:True,EnforceComplexity:True)]",
"SqlSecurity.Password": "[if(variable('Test.SqlSecurity.Password'),variable('Generate.SqlSecurity.Password'),parameter('SqlSecurityPassword'))]",
"SitecoreXP0:SqlSecurity.Password": "[variable('SqlSecurity.Password')]",
"Test.SqlSecurity.Password": "[equal(parameter('SqlSecurityPassword'),'SIF-Default')]",
"Generate.SqlSecurity.Password": "[randomstring(Length:20,DisAllowSpecial:True,EnforceComplexity:True)]",
"SqlMaster.Password": "[if(variable('Test.SqlMaster.Password'),variable('Generate.SqlMaster.Password'),parameter('SqlMasterPassword'))]",
"SitecoreXP0:SqlMaster.Password": "[variable('SqlMaster.Password')]",
"Test.SqlMaster.Password": "[equal(parameter('SqlMasterPassword'),'SIF-Default')]",
"Generate.SqlMaster.Password": "[randomstring(Length:20,DisAllowSpecial:True,EnforceComplexity:True)]",
"SqlWeb.Password": "[if(variable('Test.SqlWeb.Password'),variable('Generate.SqlWeb.Password'),parameter('SqlWebPassword'))]",
"SitecoreXP0:SqlWeb.Password": "[variable('SqlWeb.Password')]",
"Test.SqlWeb.Password": "[equal(parameter('SqlWebPassword'),'SIF-Default')]",
"Generate.SqlWeb.Password": "[randomstring(Length:20,DisAllowSpecial:True,EnforceComplexity:True)]",
"SqlProcessingTasks.Password": "[if(variable('Test.SqlProcessingTasks.Password'),variable('Generate.SqlProcessingTasks.Password'),parameter('SqlProcessingTasksPassword'))]",
"SitecoreXP0:SqlProcessingTasks.Password": "[variable('SqlProcessingTasks.Password')]",
"Test.SqlProcessingTasks.Password": "[equal(parameter('SqlProcessingTasksPassword'),'SIF-Default')]",
"Generate.SqlProcessingTasks.Password": "[randomstring(Length:20,DisAllowSpecial:True,EnforceComplexity:True)]",
"SqlForms.Password": "[if(variable('Test.SqlForms.Password'),variable('Generate.SqlForms.Password'),parameter('SqlFormsPassword'))]",
"SitecoreXP0:SqlForms.Password": "[variable('SqlForms.Password')]",
"Test.SqlForms.Password": "[equal(parameter('SqlFormsPassword'),'SIF-Default')]",
"Generate.SqlForms.Password": "[randomstring(Length:20,DisAllowSpecial:True,EnforceComplexity:True)]",
"SqlExmMaster.Password": "[if(variable('Test.SqlExmMaster.Password'),variable('Generate.SqlExmMaster.Password'),parameter('SqlExmMasterPassword'))]",
"SitecoreXP0:SqlExmMaster.Password": "[variable('SqlExmMaster.Password')]",
"Test.SqlExmMaster.Password": "[equal(parameter('SqlExmMasterPassword'),'SIF-Default')]",
"Generate.SqlExmMaster.Password": "[randomstring(Length:20,DisAllowSpecial:True,EnforceComplexity:True)]",
"Sitecore.Admin.Password": "[if(variable('Test.Admin.Password'),variable('Generate.Admin.Password'),parameter('SitecoreAdminPassword'))]",
"SitecoreXP0:Sitecore.Admin.Password": "[variable('Sitecore.Admin.Password')]",
"Test.Admin.Password": "[equal(parameter('SitecoreAdminPassword'),'SIF-Default')]",
"Generate.Admin.Password": "[randomstring(Length:20,DisAllowSpecial:True,EnforceComplexity:True)]",
"Client.Secret" : "[if(variable('Test.Client.Secret'),variable('Generate.Client.Secret'),parameter('ClientSecret'))]",
"IdentityServer:Client.Secret": "[variable('Client.Secret')]",
"SitecoreXP0:Sitecore.IdentitySecret": "[variable('Client.Secret')]",
"Test.Client.Secret": "[equal(parameter('ClientSecret'),'SIF-Default')]",
"Generate.Client.Secret": "[randomstring(Length:100,DisAllowSpecial:True)]"
},
"Includes": {
"SolrCertificates": {
"Source": ".\\createcert.json"
},
"Solr": {
"Source": ".\\SolrServer.json"
},
"IdentityServerCertificates":{
"Source": ".\\createcert.json"
},
"IdentityServer": {
"Source": ".\\identityServer.json"
},
"XConnectCertificates": {
"Source": ".\\createcert.json"
},
"XConnectSolr": {
"Source": ".\\xconnect-solr.json"
},
"XConnectXP0": {
"Source": ".\\xconnect-xp0.json"
},
"SitecoreSolr": {
"Source": ".\\Sitecore-solr.json"
},
"SitecoreXP0": {
"Source": ".\\Sitecore-XP0.json"
}
},
"Register": {
"Tasks": {
"OutNull": "Out-Null"
}
},
"Tasks": {
"GeneratePasswords": {
"Description": "Generates all shared passwords and secrets.",
"Type": "OutNull",
"Params": {
"InputObject": [
"[variable('SqlProcessingPools.Password')]",
"[variable('SqlCollection.Password')]",
"[variable('SqlReferenceData.Password')]",
"[variable('SqlMarketingAutomation.Password')]",
"[variable('SqlMessaging.Password')]",
"[variable('SqlProcessingEngine.Password')]",
"[variable('SqlReporting.Password')]",
"[variable('SqlCore.Password')]",
"[variable('SqlSecurity.Password')]",
"[variable('SqlMaster.Password')]",
"[variable('SqlWeb.Password')]",
"[variable('SqlProcessingTasks.Password')]",
"[variable('SqlForms.Password')]",
"[variable('SqlExmMaster.Password')]",
"[variable('Sitecore.Admin.Password')]",
"[variable('Client.Secret')]"
]
}
}
}
}
# The Prefix that will be used on SOLR, Website and Database instances.
$Prefix = "sc910"
# The Password for the Sitecore Admin User. This will be regenerated if left on the default.
$SitecoreAdminPassword = "b"
# The root folder with the license file and WDP files.
$SCInstallRoot = "C:\Users\Administrator\Downloads"
# The name for the XConnect service.
$XConnectSiteName = "$prefix.xconnect"
# The Sitecore site instance name.
$SitecoreSiteName = "$prefix.sc"
# Identity Server site name
$IdentityServerSiteName = "$prefix.identityserver"
# The Path to the license file
$LicenseFile = "$SCInstallRoot\license.xml"
# Solr host name
$SolrHost = "solr";
# The URL of the Solr Server
$SolrUrl = "https://solr:8983/solr"
# The Folder that Solr has been installed to.
$SolrRoot = "C:\Solr\solr-7.2.1"
# The Name of the Solr Service.
$SolrService = "Solr-7.2.1"
# The DNS name or IP of the SQL Instance.
$SqlServer = "localhost"
# A SQL user with sysadmin privileges.
$SqlAdminUser = "sa"
# The password for $SQLAdminUser.
$SqlAdminPassword = "P@55w0rd"
# The path to the XConnect Package to Deploy.
$XConnectPackage = (Get-ChildItem "$SCInstallRoot\Sitecore 9.1.0 rev. * (OnPrem)_xp0xconnect.scwdp.zip").FullName
# The path to the Sitecore Package to Deploy.
$SitecorePackage = (Get-ChildItem "$SCInstallRoot\Sitecore 9.1.0 rev. * (OnPrem)_single.scwdp.zip").FullName
# The path to the Identity Server Package to Deploy.
$IdentityServerPackage = (Get-ChildItem "$SCInstallRoot\Sitecore.IdentityServer 2.0.0 rev. * (OnPrem)_identityserver.scwdp.zip").FullName
# The Identity Server password recovery URL, this should be the URL of the CM Instance
$PasswordRecoveryUrl = "http://$SitecoreSiteName"
# The URL of the Identity Server
$SitecoreIdentityAuthority = "https://$IdentityServerSiteName"
# The URL of the XconnectService
$XConnectCollectionService = "https://$XConnectSiteName"
# The random string key used for establishing connection with IdentityService. This will be regenerated if left on the default.
$ClientSecret = "SIF-Default"
# Pipe-separated list of instances (URIs) that are allowed to login via Sitecore Identity.
$AllowedCorsOrigins = "http://$SitecoreSiteName"
# Install XP0 via combined partials file.
$singleDeveloperParams = @{
Path = "$SCInstallRoot\XP0-SingleDeveloper.json"
SqlServer = $SqlServer
SqlAdminUser = $SqlAdminUser
SqlAdminPassword = $SqlAdminPassword
SitecoreAdminPassword = $SitecoreAdminPassword
SolrHost = $SolrHost
SolrUrl = $SolrUrl
SolrRoot = $SolrRoot
SolrService = $SolrService
Prefix = $Prefix
XConnectCertificateName = $XConnectSiteName
IdentityServerCertificateName = $IdentityServerSiteName
IdentityServerSiteName = $IdentityServerSiteName
LicenseFile = $LicenseFile
XConnectPackage = $XConnectPackage
SitecorePackage = $SitecorePackage
IdentityServerPackage = $IdentityServerPackage
XConnectSiteName = $XConnectSiteName
SitecoreSitename = $SitecoreSiteName
PasswordRecoveryUrl = $PasswordRecoveryUrl
SitecoreIdentityAuthority = $SitecoreIdentityAuthority
XConnectCollectionService = $XConnectCollectionService
ClientSecret = $ClientSecret
AllowedCorsOrigins = $AllowedCorsOrigins
}
Push-Location $SCInstallRoot
Install-SitecoreConfiguration @singleDeveloperParams *>&1 | Tee-Object XP0-SingleDeveloper.log
# Uncomment the below line and comment out the above if you want to remove the XP0 SingleDeveloper Config
#Uninstall-SitecoreConfiguration @singleDeveloperParams *>&1 | Tee-Object XP0-SingleDeveloper-Uninstall.log
Pop-Location
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment