Update and Deploy Permissions
We need to update a permission set to ensure that the function we create can access data in our Salesforce org. A permission set is a collection of settings and permissions that give users and apps access to various tools and data in Salesforce.
Update the Functions Permission Set
When you connect your org to Salesforce Functions via the Functions Setup page, Salesforce creates a Functions permission set with minimal permissions. Update that permission set to give your Function access to the Account object.
To update the Functions permission set, add the file
force-app/main/default/permissionsets/Functions.permissionset-meta.xml, with contents:
These permissions allow a running Function in a compute environment connected to your org to access the Account object.
Deploy the Functions Permission Set
force:source:push with the "force overwrite" flag to push your changes to the Functions permission set to your scratch org:
In VS Code, from the Command Palette, choose SFDX: Deploy This Source File to Org.