Oracle Functions and .NET - Getting Started Part 1
So it’s been about two and a half months at Oracle Cloud, and I thought it was time I started figuring out Oracle Functions.
Oracle functions are slightly different from the “Function As A Service” (FaaS) model used at other cloud providers in that it builds on the open-source Fn Project. This means that you can build Oracle Functions and have confidence that you aren’t being locked into a single runtime environment. You could, for example, set up and run the Fn Project on-prem if you wanted/needed to. (that will be a blog post for another day.)
Ok, so let’s get set up to build our first Oracle Function!
Environment
I already have a development machine ready to go. This is an Ubuntu desktop. I have some of the usual development tools installed, including:
.NET SDK - I mean… it’s me, right?!?
Python 3.x
NodeJS
VS Code
Docker
Preparing your OCI Account
The first step in setting up any project in OCI is to create a compartment for your work. Think of compartments as logical segmentation of your OCI Tenancy. Compartments aren’t strictly required but are a best practice to help you organize your account. If you are starting a new project, consider creating a new OCI compartment.
You can create a new compartment in the “Identity and Security” section of the OCI console. Note that all accounts have a default compartment that is the root of your OCI tenancy. I’ll create a new sub-compartment named dev-functions.

Once I have my compartment I am going to head over to the Developer Services | Functions area in the console.
Virtual Cloud Network (VCN)
The next thing you want to set up when working with functions will be a Virtual Cloud Network or a VNC. This is a software-defined network in which your functions will be executed. OCI has a convenient VCN wizard that sets up the VCN for you.
In the console, select Networking | Virtual Cloud Networks. Make sure your compartment is selected, and then click “Start VCN Wizard.” From the Start VCN Wizard panel, select the default option to “Create VCN with Internet Connectivity” and click “Start VCN Wizard.”

Supply a name for your VCN as well as a CIDR block.

Accept the default options for the CIDR blocks for your subnets, and then click “Next“. At the “Review and Create” page, click “Create.” This will quickly build a new VCN for us to deploy functions into.
Applications
In OCI, functions are grouped into applications. This allows you to bundle all of your functions together that are related to a specific business function or ‘Application’. Once in the Functions area of the console, the first thing I will do is create a new application inside my compartment. This Application will act as a group for the initial functions that I will create.
Make sure your compartment is selected and then click “Create Application.”

Give your application a name, select the VCN that was created earlier, and some appropriate subnets for your functions to be deployed in.

Tiy will normally want to select the private subnet for your functions. This adds a level of protection in that your functions will not be directly accessible from outside of your VNC. Best practice is to always keep things private unless you have a specific need to do otherwise.

Your application will be set up fairly quickly and ready to go!
Create an Oracle Cloud Image Repository
In order to publish functions, you need to create an image repository. This is where your function images will be pushed from your development environment.
From the OCI hamburger menu, select Developer Services and Container Registry.

Select the option to create a new repository. Select your compartment and provide a name for your repository.

Click “Create” to create your repository.
Once your repository has been created, find the repository in the UI and copy the Namespace. You will need this for later.

What’s next?
Head over to Part 2 to get your local environment set up.

