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. In a web browser, go to https://cloud.oracle.com/home and click Sign In.
  2. From the Cloud Account menu, select Traditional Cloud Account, select your data center, and click My Services.
  3. Enter your identity domain and click Go.
  4. Enter your cloud account credentials and click Sign In.
  5. In the Oracle Cloud My Services dashboard, click Action Action menu icon and select Oracle Application Container Cloud Service.
  6. In the Applications list view, click Create Application and select Dotnet.
  7. In the Application section, enter a name for your application and click Browse.
  8. On the File Upload dialog box, select the sample-app.zip file that you created in the previous section and click Open.
  9. Keep the default values in the Instances and Memory fields and click Create.
  10. Wait until the application is created. The URL is enabled when the creation is completed.
  11. Click the URL of your application.
    DotNetSample application response
    Description of the illustration dotnet-app-response.png

more informationWant to Learn More?