Making a function private
Written by
Updated at June 9, 2025
For a function to be invoked only by users with rights to invoke it, make the function private.
Note
If all unauthorized users (the All users public group) of a cloud or folder are granted permissions to invoke a function, the function will be public regardless of its settings. How to revoke a role.
Management console
CLI
- In the management console
, select the folder containing the function. - Select Cloud Functions.
- Select the function you want to make private.
- On the Overview page, disable Public function.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
To make a function private, run the command:
yc serverless function deny-unauthenticated-invoke <function_name>
Result:
done (1s)