IdentityServer.Config.json 2.67 KB
Newer Older
1 2
{
  "Parameters": {
3 4 5 6 7
	"ScInstallDirectory": {
      "Type": "string",
      "Description": "The install directory for the site.",
      "DefaultValue": ""
    },
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
    "CommerceInstallRoot": {
      "Type": "string",
      "Description": "The root path of commerce services.",
      "DefaultValue": ""
    },
    "SitecoreIdentityServerApplicationName": {
      "Type": "string",
      "Description": "Application name of Sitecore Identity Server in the IIS",
      "DefaultValue": ""
    },
    "CommerceServicesHostPostfix": {
      "Type": "string",
      "Description": "The postfix for Commerce Engine services host names",
      "DefaultValue": ""
    },
    "CommerceAuthoringServicesPort": {
      "Type": "string",
      "Description": "The postfix for Commerce Engine services host names",
      "DefaultValue": "5000"
    },
    "BizFxPort": {
      "Type": "string",
      "Description": "The postfix for Commerce Engine services host names",
      "DefaultValue": "4200"
    }
  },
  "Variables": {
    "AuthoringLocalhost": "[concat('https://localhost:', parameter('CommerceAuthoringServicesPort'))]",
    "BizfxLocalhost": "[concat('https://localhost:', parameter('BizFxPort'))]",
    "Group1": "[concat(variable('BizfxLocalhost'), '|', variable('AuthoringLocalhost')))]",
    "AuthoringUrl": "[concat('https://commerceauthoring.', parameter('CommerceServicesHostPostfix'))]",
    "BizfxUrl": "[concat('https://bizfx.', parameter('CommerceServicesHostPostfix'))]",
    "Group2": "[concat(variable('BizfxUrl'), '|', variable('AuthoringUrl'))]"
  },
  "Tasks": {
    "UpdateAllowedCorsOriginsGroup1": {
      "Type": "SetXml",
      "Params": {
        "FilePath": ".\\IdentityServer\\Sitecore.Commerce.IdentityServer.Host.xml",
        "XPath": "//Settings/Sitecore/IdentityServer/Clients/CommerceClient/AllowedCorsOrigins/AllowedCorsOriginsGroup1",
        "Value": "[variable('Group1')]"
      }
    },
    "AddAllowedCorsOriginsGroup2": {
      "Skip": "[not(parameter('CommerceServicesHostPostfix'))]",
      "Type": "SetXml",
      "Params": {
        "FilePath": ".\\IdentityServer\\Sitecore.Commerce.IdentityServer.Host.xml",
        "XPath": "//Settings/Sitecore/IdentityServer/Clients/CommerceClient/AllowedCorsOrigins",
        "Element": "AllowedCorsOriginsGroup2",
        "Value": "[variable('Group2')]"
      }
    },
    "CopyIdentityServerCommerceConfiguration": {
      "Type": "Copy",
      "Params": {
        "Source": ".\\IdentityServer\\Sitecore.Commerce.IdentityServer.Host.xml",
65
        "Destination": "[joinpath(parameter('ScInstallDirectory'),  concat(parameter('SitecoreIdentityServerApplicationName'), '\\Config\\production\\Sitecore.Commerce.IdentityServer.Host.xml'))]"
66 67 68 69
      }
    }
  }
}