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.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay