{ "Parameters": { "CommerceInstallRoot": { "Type": "string", "Description": "The root path of commerce services.", "DefaultValue": "" }, "CommerceEngineWdpFullPath": { "Type": "string", "Description": "The path to the Web Deploy package to deploy.", "DefaultValue": "" }, "SiteName": { "Type": "string", "Description": "The name of the site to be deployed.", "DefaultValue": "" }, "SiteHostHeaderName": { "Type": "string", "Description": "The host header name of the site to be deployed.", "DefaultValue": "" }, "SitecoreUsername": { "Type": "string", "Description": "Sitecore Admin Username", "DefaultValue": "" }, "SitecoreDomain": { "Type": "string", "Description": "Sitecore Admin Domain", "DefaultValue": "sitecore" }, "SitecoreUserPassword": { "Type": "string", "Description": "Sitecore Admin Password", "DefaultValue": "" }, "HostPrefix": { "Type": "string", "Description": "The prefix to the host name.", "DefaultValue": "" }, "CommerceServicesHostPostfix": { "Type": "string", "Description": "The postfix for Commerce Engine services host names", "DefaultValue": "" }, "EnvironmentName": { "Type": "string", "Description": "The environment name.", "DefaultValue": "" }, "Port": { "Type": "string", "Description": "The port of the site to be deployed.", "DefaultValue": "" }, "SitecoreIdentityServerUrl": { "Type": "string", "Description": "The identity server full hostname.", "DefaultValue": "" }, "CommerceEngineConnectClientId": { "Type": "string", "Description": "Commerce Engine Connect Client Id used for the Sitecore Identity Server.", "DefaultValue": "" }, "MinionInstance": { "Type": "string", "Description": "Specifies whether the instance is the minion.", "DefaultValue": "false" }, "BizFxPort": { "Type": "string", "Description": "Sitecore BizFx Server port", "DefaultValue": "4200" }, "CommerceServicesDbServer": { "Type": "string", "Description": "Sitecore database server name", "DefaultValue": "" }, "SqlAdminUser": { "Type": "string", "Description": "Sql Server username", "DefaultValue": "sa" }, "SqlAdminPassword": { "Type": "string", "Description": "Sql Server password", "DefaultValue": "12345" }, "CommerceServicesDbName": { "Type": "string", "Description": "The Commerce Engine database name.", "DefaultValue": "SitecoreCommerce9_SharedEnvironments" }, "CommerceServicesGlobalDbName": { "Type": "string", "Description": "The Commerce Engine global database name", "DefaultValue": "SitecoreCommerce9_Global" }, "UserDomain": { "Type": "string", "Description": "User Domain", "DefaultValue": "$env:COMPUTERNAME" }, "UserName": { "Type": "string", "Description": "User Name for Commerce Services App Pool", "DefaultValue": "" }, "UserPassword": { "Type": "string", "Description": "User Password for Commerce Services App Pool", "DefaultValue": "" }, "SolrUrl": { "Type": "string", "Description": "The Solr instance url.", "DefaultValue": "https://localhost:8994/solr" }, "SearchIndexPrefix": { "Type": "string", "DefaultValue": "", "Description": "The search index prefix." }, "StorefrontIndexPrefix": { "Type": "string", "DefaultValue": "", "Description": "The storefront index prefix." }, "BraintreeMerchantId": { "Type": "string", "Description": "Braintree MerchantId", "DefaultValue": "" }, "BraintreePublicKey": { "Type": "string", "Description": "Braintree PublicKey", "DefaultValue": "" }, "BraintreePrivateKey": { "Type": "string", "Description": "Braintree PrivateKey", "DefaultValue": "" }, "BraintreeEnvironment": { "Type": "string", "Description": "Braintree Environment", "DefaultValue": "" }, "RedisConfiguration": { "Type": "string", "Description": "Redis service configuration.", "DefaultValue": "" }, "RedisInstanceName": { "Type": "string", "Description": "Redis service instance name.", "DefaultValue": "" }, "EngineShopsUrl": { "Type": "string", "Description": "The url for Shops", "DefaultValue": "" }, "EngineAuthoringUrl": { "Type": "string", "Description": "The url for Authoring", "DefaultValue": "" }, "EngineMinionsUrl": { "Type": "string", "Description": "The url for Minions", "DefaultValue": "" } }, "Register": { "Tasks": { "RemoveItem": "Remove-Item" } }, "Variables": { "Site.Name": "[parameter('SiteName')]", "Environment.Name": "[parameter('EnvironmentName')]", "Host.Prefix": "[parameter('HostPrefix')]", "Minion.Instance": "[parameter('MinionInstance')]", "Site.PhysicalPath": "[joinpath(parameter('CommerceInstallRoot'), variable('Site.Name'))]", "Client.Cert.Store": "cert:\\LocalMachine\\My", "Security.Localhost.CertificateThumbprint": "[GetCertificateThumbprint('localhost', variable('Client.Cert.Store'))]", "DnsName": "[concat('*.', parameter('CommerceServicesHostPostfix'))]", "Security.Dns.CertificateThumbprint": "[GetCertificateThumbprint(variable('DnsName'), variable('Client.Cert.Store'))]", "Sql.Global.ConnectionString": "[SqlConnectionString(parameter('CommerceServicesDbServer'), parameter('CommerceServicesGlobalDbName'), parameter('SqlAdminUser'), parameter('SqlAdminPassword'))]", "Sql.Shared.ConnectionString": "[SqlConnectionString(parameter('CommerceServicesDbServer'), parameter('CommerceServicesDbName'), parameter('SqlAdminUser'), parameter('SqlAdminPassword'))]", "WebsiteHostName": "[concat(variable('Host.Prefix'), concat('.', parameter('CommerceServicesHostPostfix')))]", "Engine.ShopsUrl": "[parameter('EngineShopsUrl')]", "Engine.AuthoringUrl": "[parameter('EngineAuthoringUrl')]", "Engine.MinionsUrl": "[parameter('EngineMinionsUrl')]", "IsCommerceServicesHostPostfixEmpty": "[equal(parameter('CommerceServicesHostPostfix'), '')]", "BizFxBindingLocalhost": "[concat('https://localhost:', parameter('BizFxPort'))]", "BizFxBindingLocalhostAndHost": "[concat('https://localhost:', parameter('BizFxPort'), '\", \"https://bizfx.', parameter('CommerceServicesHostPostfix'))]", "BizFxBindings": "[if(variable('IsCommerceServicesHostPostfixEmpty'), variable('BizFxBindingLocalhost'), variable('BizFxBindingLocalhostAndHost'))]" }, "Tasks": { "CreatePaths": { "Description": "Ensure the destination path for the site exists.", "Type": "EnsurePath", "Params": { "Exists": [ "[variable('Site.PhysicalPath')]" ] } }, "CreateAppPool": { "Skip": "[equal(variable('Minion.Instance'), 'true')]", "Description": "Creates or updates the app pool.", "Type": "AppPool", "Params": { "Name": "[variable('Site.Name')]", "Properties": { "ProcessModel": { "identityType": "SpecificUser", "userName": "[concat(parameter('UserDomain'), concat('\\', parameter('UserName')))]", "password": "[parameter('UserPassword')]", "idleTimeout": "00:20:00", "idleTimeoutAction": "0" }, "Recycling": { "PeriodicRestart": { "time": "29:00:00" } }, "ManagedPipelineMode": "Integrated", "ManagedRuntimeVersion": "", "startmode": "OnDemand", "autostart": "true" } } }, "CreateAppPoolForMinion": { "Skip": "[equal(variable('Minion.Instance'), 'false')]", "Description": "Creates or updates the app pool.", "Type": "AppPool", "Params": { "Name": "[variable('Site.Name')]", "Properties": { "ProcessModel": { "identityType": "SpecificUser", "userName": "[concat(parameter('UserDomain'), concat('\\', parameter('UserName')))]", "password": "[parameter('UserPassword')]", "idleTimeout": "00:00:00", "idleTimeoutAction": "1" }, "Recycling": { "PeriodicRestart": { "time": "00:00:00" } }, "ManagedPipelineMode": "Integrated", "ManagedRuntimeVersion": "", "startmode": "AlwaysRunning", "autostart": "true" } } }, "CreateWebsite": { "Skip": "[equal(variable('Minion.Instance'), 'true')]", "Description": "Creates or updates the IIS website instance.", "Type": "Website", "Params": { "Name": "[variable('Site.Name')]", "ApplicationPool": "[variable('Site.Name')]", "PhysicalPath": "[variable('Site.PhysicalPath')]" } }, "CreateWebsiteForMinion": { "Skip": "[equal(variable('Minion.Instance'), 'false')]", "Description": "Creates or updates the IIS website instance.", "Type": "Website", "Params": { "Name": "[variable('Site.Name')]", "ApplicationPool": "[variable('Site.Name')]", "PhysicalPath": "[variable('Site.PhysicalPath')]", "Properties": { "ApplicationDefaults": { "preloadEnabled": "true" } } } }, "StopWebsite": { "Description": "Stops the website if it is running.", "Type": "ManageWebsite", "Params": { "Name": "[variable('Site.Name')]", "Action": "Stop" } }, "StopAppPool": { "Description": "Stops the app pool if it is running.", "Type": "ManageAppPool", "Params": { "Name": "[variable('Site.Name')]", "Action": "Stop" } }, "RemoveDefaultBinding": { "Description": "Removes the default *:80 web binding.", "Type": "WebBinding", "Params": { "SiteName": "[variable('Site.Name')]", "Remove": [ { "Port": "80", "IPAddress": "*" } ] } }, "CreateBindings": { "Description": "Configures the site bindings for the website.", "Type": "WebBinding", "Params": { "SiteName": "[variable('Site.Name')]", "Add": [ { "HostHeader": "localhost", "Port": "[parameter('Port')]", "Protocol": "https", "SSLFlags": 1, "Thumbprint": "[variable('Security.Localhost.CertificateThumbprint')]" } ] } }, "CreateHostBinding": { "Skip": "[not(parameter('CommerceServicesHostPostfix'))]", "Type": "WebBinding", "Params": { "SiteName": "[variable('Site.Name')]", "Add": [ { "HostHeader": "[variable('WebsiteHostName')]", "Port": "443", "Protocol": "https", "SSLFlags": 1, "Thumbprint": "[variable('Security.Dns.CertificateThumbprint')]" } ] } }, "CreateHostHeader": { "Skip": "[not(parameter('CommerceServicesHostPostfix'))]", "Type": "HostHeader", "Params": { "HostName": "[variable('WebsiteHostName')]" } }, "SetPermissions": { "Description": "Sets permissions for the app pool user.", "Type": "FilePermissions", "Params": { "Path": "[variable('Site.PhysicalPath')]", "Rights": [ { "User": "[concat('IIS AppPool\\', variable('Site.Name'))]", "FileSystemRights": "FullControl", "InheritanceFlags": [ "ContainerInherit", "ObjectInherit" ] } ] } }, "InstallWdpSOLR": { "Type": "WebDeploy", "Params": { "Verb": "Sync", "Arguments": { "Source": { "Package": "[resolvepath(parameter('CommerceEngineWdpFullPath'))]" }, "Dest": "Auto", "SetParam": [ { "Name": "IIS Web Application Name", "Value": "[variable('Site.Name')]" }, { "Name": "CommerceEngineGlobalConnectionString-Admin", "Value": "[variable('Sql.Global.ConnectionString')]" }, { "Name": "CommerceEngineSharedConnectionString-Admin", "Value": "[variable('Sql.Shared.ConnectionString')]" }, { "Name": "SiteTitle", "Value": "[variable('Site.Name')]" }, { "Name": "EnvironmentName", "Value": "[variable('Environment.Name')]" }, { "Name": "SitecoreIdentityServerUrl", "Value": "[parameter('SitecoreIdentityServerUrl')]" }, { "Name": "BizFxUrl", "Value": "[variable('BizFxBindings')]" }, { "Name": "SxaStorefrontUrl", "Value": "[concat('https://', parameter('SiteHostHeaderName'))]" }, { "Name": "CommerceServicesHostPostfix", "Value": "[parameter('CommerceServicesHostPostfix')]" }, { "Name": "GlobalDatabaseName", "Value": "[parameter('CommerceServicesGlobalDbName')))]" }, { "Name": "GlobalDatabaseUserName", "Value": "[concat(parameter('UserDomain'), concat('\\\\', parameter('UserName')))]" }, { "Name": "GlobalDatabasePassword", "Value": "[parameter('SqlAdminPassword')]" }, { "Name": "GlobalDatabaseServer", "Value": "[parameter('CommerceServicesDbServer')]" }, { "Name": "SharedDatabaseName", "Value": "[parameter('CommerceServicesDbName')))]" }, { "Name": "SharedDatabaseUserName", "Value": "[concat(parameter('UserDomain'), concat('\\\\', parameter('UserName')))]" }, { "Name": "SharedDatabasePassword", "Value": "[parameter('SqlAdminPassword')]" }, { "Name": "SharedDatabaseServer", "Value": "[parameter('CommerceServicesDbServer')]" }, { "Name": "SitecoreHost", "Value": "[parameter('SiteHostHeaderName')]" }, { "Name": "SitecoreUsername", "Value": "[parameter('SitecoreUsername')]" }, { "Name": "SitecoreDomain", "Value": "[parameter('SitecoreDomain')]" }, { "Name": "SitecorePassword", "Value": "[parameter('SitecoreUserPassword')]" }, { "Name": "EngineShopsUrl", "Value": "[variable('Engine.ShopsUrl')]" }, { "Name": "EngineAuthoringUrl", "Value": "[variable('Engine.AuthoringUrl')]" }, { "Name": "EngineMinionsUrl", "Value": "[variable('Engine.MinionsUrl')]" }, { "Name": "BraintreeMerchantId", "Value": "[parameter('BraintreeMerchantId')]" }, { "Name": "BraintreePublicKey", "Value": "[parameter('BraintreePublicKey')]" }, { "Name": "BraintreePrivateKey", "Value": "[parameter('BraintreePrivateKey')]" }, { "Name": "BraintreeEnvironment", "Value": "[parameter('BraintreeEnvironment')]" }, { "Name": "SolrUrl", "Value": "[parameter('SolrUrl')]" }, { "Name": "SearchIndexPrefix", "Value": "[parameter('SearchIndexPrefix')]" }, { "Name": "StorefrontIndexPrefix", "Value": "[parameter('StorefrontIndexPrefix')]" }, { "Name": "StorefrontSolrIndexPrefix", "Value": "[parameter('StorefrontIndexPrefix')]" }, { "Name": "Configuration", "Value": "[parameter('RedisConfiguration')]" }, { "Name": "InstanceName", "Value": "[parameter('RedisInstanceName')]" }, { "Name": "CommerceEngineConnectClientId", "Value": "[parameter('CommerceEngineConnectClientId')]" } ] } } }, "StartAppPool": { "Description": "Starts the app pool.", "Type": "ManageAppPool", "Params": { "Name": "[variable('Site.Name')]", "Action": "Start" } }, "StartWebsite": { "Description": "Starts the website.", "Type": "ManageWebsite", "Params": { "Name": "[variable('Site.Name')]", "Action": "Start" } } }, "UninstallTasks": { "Uninstall-StopWebsite": { "Description": "Stops the website if it is running.", "Type": "ManageWebsite", "Params": { "Name": "[variable('Site.Name')]", "Action": "Stop", "ErrorAction": "SilentlyContinue" } }, "Uninstall-RemoveWebsite": { "Description": "Removes the website.", "Type": "RemoveWebsite", "Params": { "Name": "[variable('Site.Name')]" } }, "Uninstall-StopAppPool": { "Description": "Stops the app pool if it is running.", "Type": "ManageAppPool", "Params": { "Name": "[variable('Site.Name')]", "Action": "Stop", "ErrorAction": "SilentlyContinue" } }, "Uninstall-RemoveAppPool": { "Description": "Removes the AppPool.", "Type": "RemoveAppPool", "Params": { "Name": "[variable('Site.Name')]" } }, "Uninstall-RemoveContent": { "Description": "Removes website content.", "Type": "RemoveItem", "Params": { "Path": "[variable('Site.PhysicalPath')]", "Recurse": true, "ErrorAction": "SilentlyContinue" } }, "Uninstall-RemoveHostHeader": { "Description": "Removes the hostheader for the website.", "Type": "HostHeader", "Params": { "HostName": "[variable('Site.Name')]", "Action": "Remove" } } } }