Pipelines/Steps/Install/OnPrem/Sitecore/XM/Scaled/9.0/2/sitecore-XM1-cd.json

{
    "Parameters": {
        "Package": {
            "Type": "string",
            "Description": "The path to the Web Deploy package to deploy."
        },
        "LicenseFile": {
            "Type": "string",
            "Description": "The path to the Sitecore license file."
        },
        "SqlDbPrefix": {
            "Type": "string",
            "Description": "The prefix used for all Sql databases."
        },
        "SolrCorePrefix": {
            "Type": "string",
            "Description": "The prefix used for all Solr cores."
        },
        "SiteName": {
            "Type": "string",
            "DefaultValue": "SitecoreXM1CD",
            "Description": "The name of the site to be deployed."
        },
        "SqlCoreUser": {
            "Type": "string",
            "DefaultValue": "coreuser",
            "Description": "The Sql user for the Core connection string in Sitecore."
        },
        "SqlCorePassword": {
            "Type": "string",
            "DefaultValue": "Test12345",
            "Description": "The Sql password for the Core connection string in Sitecore."
        },
        "SqlWebUser": {
            "Type": "string",
            "DefaultValue": "webuser",
            "Description": "The Sql user for the Web connection string in Sitecore."
        },
        "SqlWebPassword": {
            "Type": "string",
            "DefaultValue": "Test12345",
            "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": "Test12345",
            "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."
        },
        "SolrZookeeperUrl": {
            "Type": "string",
            "DefaultValue": "localhost:2181",
            "Description": "The Zookeeper instance to use."
        },
        "InstallDirectory": {
            "Type": "string",
            "Description": "Installation directory"
        }
    },
    "Variables": {
        "Sql.Database.Core": "[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')]",
        "Site.PhysicalPath": "[parameter('InstallDirectory')]",
        "Site.DataFolder": "[joinpath(variable('Site.PhysicalPath'), 'App_Data')]"
    },
    "Tasks": {
        "CreatePaths": {
            "Type": "EnsurePath",
            "Params": {
                "Exists": [
                    "[variable('Site.PhysicalPath')]"
                ]
            }
        },
        "CreateAppPool": {
            "Type": "AppPool",
            "Params": {
                "Name": "[parameter('SiteName')]",
                "Properties": {
                    "ProcessModel": {
                        "identityType": "ApplicationPoolIdentity"
                    }
                }
            }
        },
        "CreateWebsite": {
            "Type": "Website",
            "Params": {
                "Name": "[parameter('SiteName')]",
                "ApplicationPool": "[parameter('SiteName')]",
                "PhysicalPath": "[variable('Site.PhysicalPath')]"
            }
        },
        "StopWebsite": {
            "Type": "ManageWebsite",
            "Params": {
                "Name": "[parameter('SiteName')]",
                "Action": "Stop"
            }
        },
        "StopAppPool": {
            "Type": "ManageAppPool",
            "Params": {
                "Name": "[parameter('SiteName')]",
                "Action": "Stop"
            }
        },
        "CreateBindings": {
            "Type": "WebBinding",
            "Params": {
                "SiteName": "[parameter('SiteName')]",
                "Add": [
                    {
                        "HostHeader": "[parameter('SiteName')]"
                    }
                ],
                "Remove": [
                    {
                        "Port": "80",
                        "IPAddress": "*"
                    }
                ]
            }
        },
        "CreateHostHeader": {
            "Type": "HostHeader",
            "Params": {
                "HostName": "[parameter('SiteName')]"
            }
        },
        "SetPermissions": {
            "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": "Core DB Name",
                            "Value": "[variable('Sql.Database.Core')]"
                        },
                        {
                            "Name": "Web DB Name",
                            "Value": "[variable('Sql.Database.Web')]"
                        },
                        {
                            "Name": "Experience Forms DB Name",
                            "Value": "[variable('Sql.Database.Forms')]"
                        },
                        {
                            "Name": "Core DB User Name",
                            "Value": "[parameter('SqlCoreUser')]"
                        },
                        {
                            "Name": "Core DB User Password",
                            "Value": "[parameter('SqlCorePassword')]"
                        },
                        {
                            "Name": "Web DB User Name",
                            "Value": "[parameter('SqlWebUser')]"
                        },
                        {
                            "Name": "Web DB User Password",
                            "Value": "[parameter('SqlWebPassword')]"
                        },
                        {
                            "Name": "Experience Forms DB User Name",
                            "Value": "[parameter('SqlFormsUser')]"
                        },
                        {
                            "Name": "Experience Forms DB User Password",
                            "Value": "[parameter('SqlFormsPassword')]"
                        },
                        {
                            "Name": "SOLR Connection String",
                            "Value": "[parameter('SolrUrl')]"
                        },
                        {
                            "Name": "SOLR Zookeeper Connection String",
                            "Value": "[parameter('SolrZookeeperUrl')]"
                        },
                        {
                            "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')]"
                        }
                    ]
                }
            }
        },
        "SetLicense": {
            "Type": "Copy",
            "Params": {
                "Source": "[resolvepath(parameter('LicenseFile'))]",
                "Destination": "[variable('Site.DataFolder')]"
            }
        },
        "StartAppPool": {
            "Type": "ManageAppPool",
            "Params": {
                "Name": "[parameter('SiteName')]",
                "Action": "Start"
            }
        },
        "StartWebsite": {
            "Type": "ManageWebsite",
            "Params": {
                "Name": "[parameter('SiteName')]",
                "Action": "Start"
            }
        }
    }
}