Oracle Cloud Infrastructure Documentation

Creating Applications

You can create applications in Oracle Functions in readiness for deploying functions. An application need not contain any functions.

You can create applications using the Console, the Fn Project CLI, and the API.

Using the Console

To create a new application in Oracle Functions using the Console:

  1. Confirm that you have completed the prerequisite steps for using Oracle Functions, as described in Preparing for Oracle Functions. Specifically, that you have:

  2. Log in to the Console as a functions developer.
  3. In the Console, open the navigation menu. Under Solutions and Platform, go to Developer Services and click Functions.
  4. Select the region you are using with Oracle Functions. Oracle recommends that you use the same region as the Docker registry that's specified in the Fn Project CLI context (see 6. Create an Fn Project CLI Context to Connect to Oracle Cloud Infrastructure).
  5. Select the compartment specified in the Fn Project CLI context (see 6. Create an Fn Project CLI Context to Connect to Oracle Cloud Infrastructure).

    The Applications page shows the applications already defined in the compartment.

  6. Click Create Application and specify:

    • A name for the new application (for example, acmeapp). Avoid entering confidential information.
    • The VCN and subnet (or subnets, up to a maximum of three) in which to run functions. For example, a VCN called acme-vcn-01 and a public subnet called Public Subnet IHsY:US-PHOENIX-AD-1). If a regional subnet has been defined, best practice is to select that subnet to make failover across availability domains simpler to implement. If a regional subnet has not been defined and you need to meet high availability requirements, select multiple subnets. Oracle recommends that the subnets are in the same region as the Docker registry that's specified in the Fn Project CLI context (see 6. Create an Fn Project CLI Context to Connect to Oracle Cloud Infrastructure).

  7. Click Create.

    The new application appears in the list of applications.

Using Fn Project CLI Commands

To create a new application in Oracle Functions using the Fn Project CLI:

  1. Log in to your development environment as a functions developer.

  2. In a terminal window, create a new application by entering:

     $ fn create app <app-name> --annotation oracle.com/oci/subnetIds='["<subnet-ocid>"]'

    where:

    • <app-name> is the name of the new application. Avoid entering confidential information.
    • <subnet-ocid> is the OCID of the subnet (or subnets, up to a maximum of three) in which to run functions. If a regional subnet has been defined, best practice is to select that subnet to make failover across availability domains simpler to implement. If a regional subnet has not been defined and you need to meet high availability requirements, specify multiple subnets (enclose each OCID in double quotes separated by commas, in the format '["<subnet-ocid>","<subnet-ocid>"]'). Oracle recommends that the subnets are in the same region as the Docker registry that's specified in the Fn Project CLI context (see 6. Create an Fn Project CLI Context to Connect to Oracle Cloud Infrastructure).

    For example:

     $ fn create app acmeapp --annotation oracle.com/oci/subnetIds='["ocid1.subnet.oc1.phx.aaaaaaaacnh..."]'

    An application is created in Oracle Functions, in the tenancy and region implied by the subnet OCID and belonging to the compartment specified in the Fn Project CLI context file.

  3. Verify that the new application has been created by entering:

    $ fn list apps

    For example:

    $ fn list apps
    			
    acmeapp

Using the API

For information about using the API and signing requests, see REST APIs and Security Credentials. For information about SDKs, see Software Development Kits and Command Line Interface.

Use these API operations to manage applications: