DEV Community

Faris Durrani
Faris Durrani

Posted on

How to switch OCI profiles in deploying an OCI Function

Oracle Cloud Infrastructure's Function is the equivalent of the serverless function Lambda in AWS.

The problem

Let's say you built an OCI Function and tried to deploy it following the instructions on the console:

Image description

but ran into the following issue:

Fn: can not create client, bad configuration: did not find a proper configuration for private key
Enter fullscreen mode Exit fullscreen mode

Image description

This could be from missing the OCI config file (in ~/.oci/config) or having multiple OCI profiles but not choosing the right one when deploying the Function.

The solution

To change the OCI profile being used, for example, from DEFAULT to fdurrani, simply run the following command before deploying the Function:

fn update context oracle.profile fdurrani
Enter fullscreen mode Exit fullscreen mode

Safe harbor statement

The information provided on this channel/article/story is solely intended for informational purposes and cannot be used as a part of any contractual agreement. The content does not guarantee the delivery of any material, code, or functionality, and should not be the sole basis for making purchasing decisions. The postings on this site are my own and do not necessarily reflect the views or work of Oracle or Mythics, LLC.

This work is licensed under a Creative Commons Attribution 4.0 International License.

Top comments (0)