0

I have setup Sitecore Serialization configuraiton for roles and was successfully able to merge pull those from local instance into project files.

{
  "$schema": "../.sitecore/schemas/ModuleFile.schema.json",
  "namespace": "ContentSettings",
  "items": {
    ...
  },
  "roles": [
    {
      "domain": "SXA",
      "pattern": "Admin"
    },
    {
      "domain": "SXA",
      "pattern": "Author"
    },
    {
      "domain": "SXA",
      "pattern": "Designer"
    },
    {
      "domain": "Client",
      "pattern": "Site Collection *"
    },
 ...

And those roles are serialized under /src/items/_roles folder.

But when we run the XM Cloud deployment, it doesn't copy those roles into our XM Cloud environment.

Is there anything extra needed to be done other than explained config configuration in xm cloud documentation ?

Any help would be highly appreciated.

1 Answer 1

2

This is because of the default way that XM Cloud deploys the serialization. The SCS files are used to generate an Item as Resources(IAR) file and that is layered into the XM Cloud instance.

Roles cannot be added via an IAR file.

To add the roles, you would need to use the scsModules post deploy action in the xmcloud.build.json file.

You need to create an SCS module that is used to serialize the roles, then in the xmcloud.build.json add a section to the post deploy actions:

"postActions": {
  "actions": {
    "scsModules": {
      "modules": ["Module1","Module2"]
    }
  }
}

This uses the SCS sync action post deployment to deploy what is in the modules.

For the "modules" array, you have to provide "namespace" value mentioned on your .module.json configuration

Ref:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.