Deploy a Custom Function to Data 360 Sandbox by Using CLI

The deployment uploads the code package to Data 360. After deployment, your function is available as a chunking strategy option in the search index builder.

Edition Table
Available in: Developer, Enterprise, Performance, and Unlimited Editions. See Data 360 edition availability.
User Permissions Needed
To deploy a custom function and use it for search index chunking:Permission set:
  • Data Cloud Architect

Prerequisites 


Deploy Your Custom Function by Using the Salesforce CLI 

  1. Open a terminal, and go to the root of your code extension function package (the folder that contains payload/).

    1cd <path-to-root-folder-of-function-package>
  2. Make sure that you are signed in to the target org.

    1sf org display --target-org <ORG_ALIAS>
  3. Refresh package metadata from the package root.

    1sf data-code-extension function scan --entrypoint ./payload/entrypoint.py
  4. Deploy your code extension function.

    1sf data-code-extension function deploy --name <DEPLOYMENT_NAME> --package-version <PACKAGE_VERSION> --description "<DESCRIPTION>" --package-dir <PACKAGE_DIR> --target-org <ORG_ALIAS> [--network <NETWORK_VALUE>] [--cpu-size CPU_L|CPU_XL|CPU_2XL|CPU_4XL]

    Example:

    1sf data-code-extension function deploy --name <DEPLOYMENT_NAME> --package-version <PACKAGE_VERSION> --description "<DESCRIPTION>" --package-dir ./payload --target-org <ORG_ALIAS> --cpu-size CPU_XL
  • --name <DEPLOYMENT_NAME> (required): Name for your code extension deployment.

  • --package-version <PACKAGE_VERSION> (required): Semantic version for the package (for example, 1.0.0).

  • --description "<DESCRIPTION>" (required): Short description of the deployment.

  • --package-dir ./payload (required): Directory that contains your packaged function (typically ./payload under the package root).

  • --target-org <ORG_ALIAS> (required): Org username or alias (same as other sf commands).

  • --cpu-size (optional): The CPU size: CPU_L, CPU_XL, CPU_2XL (default), or CPU_4XL. Larger sizes provide more processing power but consume more credits. To understand how the compute size affects the compute model and credit consumption, see Salesforce Help: Billing Considerations for Code Extension.

  • --network (optional): Network setting for packages that include Jupyter notebooks (for example, host for host network mode).

    Example:

    1sf data-code-extension function deploy --name my_chunking_function --package-version 1.0.0 --description "Custom chunking for product pages" --package-dir ./payload --target-org myorg --cpu-size CPU_L
  1. Confirm that the code deployment is successful. See Monitor Custom Function Deployments.

Next Step 

See Also