Deleting a Function

Find out how to delete a function with OCI Functions.

For prerequisites and more information, see Deleting Functions.

  • When using the Console to delete functions, note the following points:

    • You can delete functions individually, or you can delete all the functions in an application by deleting the application itself (hence the potential requirement for the FN_APP_DELETE permission).
    • You're always prompted to confirm deletion because you cannot undelete an application or function later.

    To delete a function in OCI Functions using the Console:

    1. Sign in to the Console as a functions developer.
    2. Open the navigation menu and click Developer Services. Under Functions, click Applications.
    3. Select the region you're using with OCI Functions.

      We recommend that you use the same region as the Docker registry that's specified in the Fn Project CLI context. See Creating an Fn Project CLI Context to Connect to Oracle Cloud Infrastructure.

    4. Select the compartment specified in the Fn Project CLI context. See Creating an Fn Project CLI Context to Connect to Oracle Cloud Infrastructure.

      The Applications page shows the applications defined in the compartment.

    5. To delete an individual function without deleting the application, use the following steps:

      1. Click the name of the application containing the function that you want to delete.
      2. On the Application Detail page, click the name of the function that you want to delete.
      3. On the Function Detail page, click Delete and confirm that you want to delete the function.

      Deleting a function doesn't delete the Docker image on which the function is based. To delete the image, you must delete it explicitly. See Deleting and Undeleting an Image.

    6. To delete all the functions in an application by deleting the application, use the following steps:

      1. Click the name of the application that you want to delete.
      2. On the Application Detail page, click Delete and confirm that you want to delete the application:

        • If the application doesn't contain functions, click Delete to confirm that you want to delete the application.
        • If the application does contain functions, a list of the functions in the application is shown. To delete the application, enter DELETE <APPLICATION-NAME> in the text box, and click Delete.

      Deleting an application and all its functions doesn't delete the Docker images on which the functions are based. To delete the images, you must delete them explicitly. For more information, see Deleting and Undeleting an Image.

  • Using the Fn Project CLI

    Tip

    From time to time, new versions of the Fn Project CLI are released. We recommend you regularly check that the latest version is installed. For more information, see Steps to upgrade the Fn Project CLI.

    When using the Fn Project CLI to delete functions, note that you cannot delete an application if it contains functions (you must delete the functions first).

    To delete a function in OCI Functions using the Fn Project CLI:

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

    2. Enter the following command to delete the function:

      fn delete function <app-name> <function-name>

      where:

      • <app-name> is the name of the application containing the function you want to delete.
      • <function-name> is the name of the function you want to delete.

      For example:

      fn delete function acmeapp acme-func
    3. Verify that the function has been deleted by entering:

      fn list functions <app-name>

      For example:

      fn list functions acmeapp

    Using the OCI CLI

    Use the oci fn function delete command and required parameters to delete a function:

    oci fn function delete --function-id <function-ocid> [OPTIONS]

    For a complete list of flags and variable options for OCI CLI commands, see the Command Line Reference.

  • Run the DeleteFunction operation to delete a function.