Oracle Cloud Infrastructure Documentation

Differences between Oracle Functions and Fn Project

In general, Oracle Functions and Fn Project are very similar. However there are some differences, as detailed below.

Differences in Authentication When Making API Calls

When you use the Oracle Cloud Infrastructure API with Oracle Functions, in the request header you have to provide:

  • the OCID of the compartment to which the function belongs
  • Oracle Cloud Infrastructure authentication details

Differences When Invoking Functions

To invoke a function deployed to Oracle Functions, you have to explicitly specify an Oracle Cloud Infrastructure endpoint (unless you're using the Fn Project CLI).

For example, when you use oci-curl to invoke a function, you have to send a request to the function's invoke endpoint (for example https://fht7ns4mn2q.us-phoenix-1.functions.oci.oraclecloud.com/20181201/functions/ocid1.fnfunc.oc1.phx.aaaa____uxoa/actions/invoke).

You can obtain the appropriate endpoint by making a call to the API, either directly or by using the Fn Project CLI command:

$ fn inspect function <app-name> <function-name>

Additional Context Configuration Parameters in Oracle Functions

As well as supporting Fn Project context configuration parameters, Oracle Functions also has some additional parameters, as shown in the following table.

Additional Parameter Set in Value Notes
provider A context configuration .yaml file in ~/.fn/contexts oracle

Enables Oracle Functions rather than Fn Project functionality. When provider is set to oracle, the following parameters are valid:

  • oracle.compartment-id
  • oracle.profile

See 6. Create an Fn Project CLI Context to Connect to Oracle Cloud Infrastructure.

oracle.compartment-id

A context configuration .yaml file in ~/.fn/contexts <compartment -ocid>

Specifies the OCID of the Oracle Cloud Infrastructure compartment that owns function-related resources.

See 6. Create an Fn Project CLI Context to Connect to Oracle Cloud Infrastructure.

oracle.profile A context configuration .yaml file in ~/.fn/contexts <profile-name>

Specifies which profile to use from the ~/.oci/config file. If not set, the profile named default is used.

See 7. Set the Context for the Fn Project CLI Using the oracle.profile Parameter

Use of Annotations

When you're creating and viewing Oracle Functions resources using the Fn Project CLI, annotations enable you to identify and specify associated Oracle Cloud Infrastructure resources.

For example:

  • When you're using the Fn Project CLI to create a new application, you use the --annotation parameter to specify the OCID of the subnet in which to run the function.
  • When you're using the Fn Project CLI to view the properties of a function, the annotations element shows the OCID of the compartment that owns the function.

Note that unlike other configuration parameters and environment variables, annotation values cannot be passed as arguments to running Docker containers.