Now that you’ve developed and tested your function locally, deploy your project so you can invoke your function from your Salesforce org. The first time a Salesforce Functions project is deployed, the upload can be 500 MB or more.
Add Project to Git
Before you deploy, commit your functions code changes to a git repo. The deploy process uses changes tracked in git to know what to deploy. Since you just created this project, add the project to a new repo.
From the root directory of your project, use the following git commands:
At this point you can optionally push your changes to github.com, but it isn’t required for deploying a function.
Your project is now ready to deploy. If you make additional changes to your function code, use git add and git commit to commit those changes to the repo before deploying again.
For more details on adding your repo to github.com, see Create a repo.
Deploy Function to Compute Environment
To deploy your project’s function, use the following command with the scratch org alias we created earlier.
1sf deploy functions -o MyOrgAlias
The deploy process can take several minutes.
To check the status of your deployed project, use sf env list.
Salesforce Functions is no longer available for purchase or renewal. To preserve the capabilities that Salesforce Functions provided to your org, deploy an alternative solution before your existing order term ends. See Salesforce Functions Retirement for more information on migrating your functions. Contact your Salesforce Account Executive for more information on Heroku.