Pipelines/Steps/Install/OnPrem/Sitecore/XM/Scaled/9.1/0/sitecore-XM1-cd.json

{
    "Parameters": {
        "Package": {
            "Type": "string",
            "Description": "The path to the Web Deploy package to deploy.",
            "DefaultValue": ""
        },
        "LicenseFile": {
            "Type": "string",
            "Description": "The path to the Sitecore license file.",
            "DefaultValue" : ".\\License.xml"
        },
        "SqlDbPrefix": {
            "Type": "string",
            "Description": "The prefix used for all Sql databases.",
            "DefaultValue": ""
        },
        "SolrCorePrefix": {
            "Type": "string",
            "Description": "The prefix used for all Solr cores.",
            "DefaultValue": ""
        },
        "SiteName": {
            "Type": "string",
            "DefaultValue": "SitecoreXM1CD",
            "Description": "The name of the site to be deployed."
        },
        "SqlSecurityUser": {
            "Type": "string",
            "DefaultValue": "securityuser",
            "Description": "The Sql user for the Security connection string in Sitecore."
        },
        "SqlSecurityPassword": {
            "Type": "string",
            "DefaultValue": "SIF-Default",
            "Description": "The Sql password for the Security connection string in Sitecore."
        },
        "SqlWebUser": {
            "Type": "string",
            "DefaultValue": "webuser",
            "Description": "The Sql user for the Web connection string in Sitecore."
        },
        "SqlWebPassword": {
            "Type": "string",
            "DefaultValue": "SIF-Default",
            "Description": "The Sql password for the Web connection string in Sitecore."
        },
        "SqlFormsUser": {
            "Type": "string",
            "DefaultValue": "formsuser",
            "Description": "The Sql user for the Experience Forms connection string in Sitecore."
        },
        "SqlFormsPassword": {
            "Type": "string",
            "DefaultValue": "SIF-Default",
            "Description": "The Sql password for the Experience Forms connection string in Sitecore."
        },
        "SqlServer": {
            "Type": "string",
            "DefaultValue": ".\\SQLSERVER",
            "Description": "The Sql Server where databases will be installed."
        },
        "SolrUrl": {
            "Type": "string",
            "DefaultValue": "https://localhost:8983/solr",
            "Description": "The Solr instance to use."
        },
        "SitecoreIdentityAuthority": {
            "Type": "string",
            "DefaultValue": "https://SitecoreIdentityServerHost",
            "Description": "IdentityServer provider URI."
        },
        "HostMappingName": {
            "Type": "string",
            "Reference": "SiteName",
            "Description": "The host name of the site."
        },
        "DnsName" :{
            "Type": "string",
            "Reference": "SiteName",
            "Description": "The dns name of the site."
        },
        "InstallDirectory": {
            "Type": "string",
            "Description": "Installation directory"
        }
    },
    "Register": {
        "Tasks": {
            "RemoveItem": "Remove-Item"
        }
    },
    "Variables": {
 
        "Sql.Database.Security":"[concat(parameter('SqlDbPrefix'), '_Core')]",
        "Sql.Database.Web": "[concat(parameter('SqlDbPrefix'), '_Web')]",
        "Sql.Database.Forms": "[concat(parameter('SqlDbPrefix'), '_ExperienceForms')]",
 
        "Solr.Web.Name": "[concat(parameter('SolrCorePrefix'), '_web_index')]",
        "Solr.MD.Web.Name": "[concat(parameter('SolrCorePrefix'), '_marketingdefinitions_web')]",
        "Solr.MA.Web.Name": "[concat(parameter('SolrCorePrefix'), '_marketing_asset_index_web')]",
        "Solr.FXM.Web.Name": "[concat(parameter('SolrCorePrefix'), '_fxm_web_index')]",
 
        "SqlWeb.Password": "[parameter('SqlWebPassword')]",
        "SqlForms.Password": "[parameter('SqlFormsPassword')]",
        "SqlSecurity.Password": "[parameter('SqlSecurityPassword')]",
 
        "Site.PhysicalPath": "[parameter('InstallDirectory')]",
        "Site.DataFolder": "[joinpath(variable('Site.PhysicalPath'), 'App_Data')]"
    },
    "Tasks": {
 
        "CreatePaths": {
            "Description":"Ensures that the destination path for the site exists.",
            "Type": "EnsurePath",
            "Params": {
                "Exists": [ "[variable('Site.PhysicalPath')]" ]
            }
        },
        "CreateAppPool": {
            "Description":"Creates or updates the app pool.",
            "Type": "AppPool",
            "Params": {
                "Name": "[parameter('SiteName')]",
                "Properties": {
                    "ProcessModel": {
                        "identityType" : "ApplicationPoolIdentity"
                    }
                }
            }
        },
        "CreateWebsite": {
            "Description":"Creates or updates the IIS website instance.",
            "Type": "Website",
            "Params": {
                "Name": "[parameter('SiteName')]",
                "ApplicationPool": "[parameter('SiteName')]",
                "PhysicalPath": "[variable('Site.PhysicalPath')]"
            }
        },
        "StopWebsite": {
            "Description":"Stops the website if it is running.",
            "Type": "ManageWebsite",
            "Params": {
                "Name": "[parameter('SiteName')]",
                "Action": "Stop"
            }
        },
        "StopAppPool": {
            "Description":" Stops the app pool if it is running.",
            "Type": "ManageAppPool",
            "Params": {
                "Name": "[parameter('SiteName')]",
                "Action": "Stop"
            }
        },
        "CreateBindings": {
            "Description":"Configures the site bindings for the website.",
            "Type": "WebBinding",
            "Params": {
                "SiteName": "[parameter('SiteName')]",
                "Add": [ { "HostHeader": "[parameter('DNSName')]" } ],
                "Remove": [ { "Port": "80", "IPAddress": "*" } ]
            }
        },
        "CreateHostHeader": {
            "Description":"Sets a hostheader for the website.",
            "Type": "HostHeader",
            "Params": {
                "HostName": "[parameter('HostMappingName')]"
            },
            "Skip": "[not(parameter('HostMappingName'))]"
        },
        "SetPermissions": {
            "Description":"Sets permissions for the app pool user.",
            "Type": "FilePermissions",
            "Params": {
                "Path" : "[variable('Site.PhysicalPath')]",
                "Rights": [
                    {
                        "User": "[concat('IIS AppPool\\', parameter('SiteName'))]",
                        "FileSystemRights": "FullControl",
                        "InheritanceFlags": [ "ContainerInherit", "ObjectInherit"]
                    }
                ]
            }
        },
        "InstallWDP": {
            "Type": "WebDeploy",
            "Params" : {
                "Verb": "Sync",
                "Arguments": {
                    "Source": {
                        "Package": "[resolvepath(parameter('Package'))]"
                    },
                    "Dest": "Auto",
                    "SetParam": [
                        { "Name": "Application Path", "Value": "[parameter('SiteName')]" },
                        { "Name": "Database Server Name", "Value": "[parameter('SqlServer')]" },
                        { "Name": "Security DB Name", "Value": "[variable('Sql.Database.Security')]" },
                        { "Name": "Web DB Name", "Value": "[variable('Sql.Database.Web')]" },
                        { "Name": "Experience Forms DB Name", "Value": "[variable('Sql.Database.Forms')]" },
                        { "Name": "Security DB User Name", "Value": "[parameter('SqlSecurityUser')]" },
                        { "Name": "Security DB User Password", "Value": "[variable('SqlSecurity.Password')]" },
                        { "Name": "Web DB User Name", "Value": "[parameter('SqlWebUser')]"},
                        { "Name": "Web DB User Password", "Value": "[variable('SqlWeb.Password')]"},
                        { "Name": "Experience Forms DB User Name", "Value": "[parameter('SqlFormsUser')]"},
                        { "Name": "Experience Forms DB User Password", "Value": "[variable('SqlForms.Password')]"},
                        { "Name": "SOLR Connection String", "Value": "[parameter('SolrUrl')]" },
                        { "Name": "Solr Web Index Name", "Value": "[variable('Solr.Web.Name')]"},
                        { "Name": "Solr Marketing Definitions Web Index Name", "Value": "[variable('Solr.MD.Web.Name')]"},
                        { "Name": "Solr Marketing Asset Web Index Name", "Value": "[variable('Solr.MA.Web.Name')]"},
                        { "Name": "Solr FXM Web Index Name", "Value": "[variable('Solr.FXM.Web.Name')]"},
                        { "Name": "Sitecore Identity Authority", "Value": "[parameter('SitecoreIdentityAuthority')]"}
                    ]
                }
            }
        },
        "SetLicense" : {
            "Description":"Copies the license file to the instance data folder.",
            "Type": "Copy",
            "Params": {
                "Source": "[resolvepath(parameter('LicenseFile'))]",
                "Destination": "[variable('Site.DataFolder')]"
            }
        },
        "StartAppPool": {
            "Description":"Starts the app pool.",
            "Type": "ManageAppPool",
            "Params": {
                "Name": "[parameter('SiteName')]",
                "Action": "Start"
            }
        },
        "StartWebsite": {
            "Description":"Starts the website.",
            "Type": "ManageWebsite",
            "Params": {
                "Name": "[parameter('SiteName')]",
                "Action": "Start"
            }
        }
    },
    "UninstallTasks": {
        "StopWebsite": {
            "Description": "Stops the website if it is running.",
            "Type": "ManageWebsite",
            "Params": {
                "Name": "[parameter('SiteName')]",
                "Action": "Stop",
                "ErrorAction": "SilentlyContinue"
            }
        },
        "StopAppPool": {
            "Description": "Stops the app pool if it is running.",
            "Type": "ManageAppPool",
            "Params": {
                "Name": "[parameter('SiteName')]",
                "Action": "Stop",
                "ErrorAction": "SilentlyContinue"
            }
        },
        "RemoveWebsite": {
            "Description": "Removes the IIS website.",
            "Type": "RemoveWebsite",
            "Params": {
                "Name": "[parameter('SiteName')]"
            }
        },
        "RemoveAppPool": {
            "Description": "Removes the IIS application pool.",
            "Type": "RemoveAppPool",
            "Params": {
                "Name": "[parameter('SiteName')]"
            }
        },
        "RemoveContent": {
            "Description": "Removes website content.",
            "Type": "RemoveItem",
            "Params": {
                "Path": "[variable('Site.PhysicalPath')]",
                "Recurse": true,
                "ErrorAction": "SilentlyContinue"
            }
        },
        "RemoveHostHeader": {
            "Description": "Removes the website host name.",
            "Type": "HostHeader",
            "Params": {
                "HostName": "[parameter('SiteName')]",
                "Action": "Remove"
            }
        }
    }
}