Create a Scratch Org
A scratch org is a source-driven and disposable deployment of Salesforce code and metadata. You'll use a scratch orgs to do your Salesforce Functions development and local testing.
Switch to your new DX project’s root directory:
config/project-scratch-def.json file to enable the "Functions" feature and save. We will use this configuration to create a new Scratch Org:
Use this updated scratch org definition file to create a new scratch org by running this command in your project's root directory:
-sset the created org as the default
-f definitionfilepath to the scratch org definition file
-aset an alias for the created scratch org
sfdx force:org:create --help for information on options.
See Scratch Orgs for more information on scratch orgs.
Create Salesforce Compute Environment for Scratch Org
After creating the scratch org, you need to create a Salesforce compute environment that is associated with the scratch org. This compute environment is where your Functions will get deployed to.
-o orgAliasAlias of the org the compute environment is connected to
-a aliasAlias for the newly created compute environment