Oracle by Example brandingDeploy a .NET Core Application to Oracle Cloud

section 0Before You Begin

This 15-minute tutorial shows you how to create a basic .NET Core application and how to deploy it to Oracle Application Container Cloud Service.

Background

Oracle Application Container Cloud Service lets you deploy .NET Core, Go, Java Platform, Standard Edition (Java SE), Node.js, PHP, Python, Ruby, and Enterprise Edition (Java EE) applications to the Oracle Cloud.

What Do You Need?


section 1Create a .NET Core Application

  1. Create the sample-app project directory in your local system.
  2. Open a command-line interface and go to the sample-app directory.
  3. Create a web .NET project.
    dotnet new web
  4. Open the Program.cs file in a text editor and add the following code in the line 23:
    .UseUrls("http://0.0.0.0:"+ Environment.GetEnvironmentVariable("PORT")) 
  5. Go back to the command-line interface, and update the project's dependencies and tools.
    dotnet restore 
  6. Create a Debug build of your app.
    dotnet build 
  7. Create a self-contained deployment for the Linux platform.
    dotnet publish -c Release -r linux-x64 

section 2Prepare Your Application to Cloud Deployment

  1. In the sample-app\bin\Release\netcoreapp2.0\linux-x64 directory, create the manifest.json file, and add the following content:
    {
      "runtime":{
         "majorVersion":"2.0.0-runtime"
    	},
    	"command": "dotnet publish/sample-app.dll"
    } 
  2. Create the sample-app.zip file with the manifest.json file and the publish directory.

section 3Deploy Your Application to Oracle Application Container Cloud Service

  1. Open the Oracle Application Container Cloud Service console.
  2. In the Applications list view, click Create Application and select Dotnet.
  3. In the Application section, enter a name for your application and click Browse.
  4. On the File Upload dialog box, select the sample-app.zip file that you created in the previous section and click Open.
  5. Keep the default values in the Instances and Memory fields and click Create.
  6. Wait until the application is created. The URL is enabled when the creation is completed.
  7. Click the URL of your application.
    DotNetSample application response
    Description of the illustration dotnet-app-response.png

more informationWant to Learn More?