Installing and Using the OCI CLI Tool

To connect to your cloud resources, Oracle Developer Tools for Visual Studio uses a config file and a private key .PEM file with the corresponding public API key registered in your Oracle Cloud account. These files can be easily generated (often completely automatically) using the OCI CLI tool.

This page shows how to install and use the OCI CLI tool.

 

Install the OCI CLI Tool

  • View the OCI CLI Quickstart webpage
  • In the Installing the OCI CLI, Windows section, follow the instructions to open powershell as Administrator and run the powershell commands. It will install Python if it is not already installed. After installing the OCI CLI, return to this web page.

Create Config File -- Fully Automated (easiest)

  • Note: This fully automated method currently does not work if you are using identity management for your cloud login. If you are using identity management, please use the manual method in the next section.
  • Open a command prompt or Powershell prompt as administrator
  • Run this command: oci setup bootstrap
  • Respond to the prompts asking for your region
  • Your web browser will open and prompt you to log in to Oracle Cloud
  • After logging in, the browser will display a message telling you to return to the command prompt (If you receive an error when returning from the web browser to the CLI, try the manual method below.)
  • In the command prompt, respond to remaining prompts. It may be necessary to delete an API key if there are already 3 API keys registered in your cloud account. You must provide a passphrase to use this config file with Visual Studio.

Create Config File -- Manual Method

  • If you are using identity management for your cloud login or wish to perform some steps manually (such as creating your own .PEM files), use these steps:
  • For details of the next few steps, please View the OCI CLI Quickstart webpageSetting up the Config File -> Use the Setup Dialog
  • Open a command prompt or Powershell prompt as administrator
  • Run this command: oci setup config
  • Respond to the prompts, getting the information for items like User OCID and Tenancy OCID from the web console or from an existing config file.
  • You will be prompted: Do you want to generate a new RSA key pair? If you choose to use an existing key pair, it must meet minimum security requirements (at least 2048 bits long and stored in a PEM format file encrypted with a passphrase using the AES algorithm) and you must use a passphrase.
  • Open this webpage and follow the directions to Upload the public API key with Oracle Cloud

Connect from Server Explorer in Visual Studio

  • In Visual Studio Server Explorer, right click on the Oracle Cloud Infrastructure node and select Add New Account Entry
  • In the dialog that opens, in the Configuration File field, browse to the newly created config file and press Open.
  • The dialog will be populated with the data from the config file. Press OK to connect.