Oracle Cloud Infrastructure Documentation

2. Create a Profile in the Oracle Cloud Infrastructure CLI Configuration File

Before using Oracle Functions, you must have an Oracle Cloud Infrastructure CLI configuration file that contains the credentials of the user account that you will be using to create and deploy functions. These user account credentials are referred to as a 'profile'.

By default, the Oracle Cloud Infrastructure CLI configuration file is located at ~/.oci/config. You might already have a configuration file as a result of installing the Oracle Cloud Infrastructure CLI. However, you don't need to have installed the Oracle Cloud Infrastructure CLI in order to use Oracle Functions.

The Oracle Cloud Infrastructure CLI configuration file can contain several profiles. If you already have a configuration file containing one or more profiles, you have to add a new profile to the existing file for the Oracle Cloud Infrastructure user who will be using Oracle Functions to create and deploy functions

The instructions in this topic assume:

To create a profile in the Oracle Cloud Infrastructure CLI configuration file for the user account that you will be using to create and deploy functions:

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

  2. In a terminal window, confirm the contents of the ~/.oci directory. For example, by entering:

    $ ls -l ~/.oci/
    
    -rw------- 1 johndoe staff 1766 Jul 14 00:24 john_api_key_private.pem
    -rw-r--r-- 1 johndoe staff 451 Jul 14 00:55 john_api_key_public.pem
  3. Do one of the following, depending on whether the ~/.oci directory already contains a file called config:

    • If the ~/.oci directory already contains a file called config, open the file in a text editor.
    • If the ~/.oci directory doesn't yet contain a file called config, create the file and open it in a text editor. For example, by entering:
      $ vim ~/.oci/config
  4. Add a new profile to the ~/.oci/config file as follows:

    [<profile-name>]
    user=<user-ocid>
    fingerprint=<public-key-fingerprint>
    key_file=<full-path-to-private-key-pem-file>
    tenancy=<tenancy-ocid>
    region=<region-identifier>
    pass_phrase=<passphrase>		

    where:

    For example:

    [john-oci-profile]
    user=ocid1.user.oc1..aaaaaaaas...7ap
    fingerprint=d1:b2:32:53:d3:5f:cf:68:2d:6f:8b:5f:77:8f:07:13
    key_file=~/.oci/john_api_key_private.pem
    tenancy=ocid1.tenancy.oc1..aaaaaaaap...keq
    region=us-phoenix-1
    pass_phrase=<your-passphrase>

When you have completed the steps in this topic, go on to 3. Create and Configure a Copy of oci-curl.