Update and Deploy Permissions
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.
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.
force:source:push with the "force overwrite" flag to push your changes to the Functions permission set to your scratch org:
-fRuns the push command even if conflicts exist.
-uA username or alias for the target org. Overrides the default target org.
In VS Code, from the Command Palette, choose SFDX: Push Source to Default Scratch Org.