Run a simple .Net application on Cloud Foundry
What is Cloud Foundry?
Cloud Foundry is an open source cloud platform as a service (PaaS) on which developers can build, deploy, run and scale applications. VMware originally created Cloud Foundry, and it is now part of Pivotal Software, whose parent company is Dell Technologies.
Additional Links: https://docs.cloudfoundry.org/concepts/overview.html
SAP and Cloud Foundry
Drive your digital transformation leveraging SAP Cloud Platform with multi-cloud architecture option and Cloud Foundry technology to deliver an open, simple, robust and flexible cloud native enterprise platform to build, deploy and manage innovative business applications.
Additional Links: https://cloudplatform.sap.com/capabilities/runtimes-containers/cloud-foundry.html
Create your Cloud Foundry Trial Instance
Get a Trial Space – A trial space allows you to try out our platform for free.
Download and Install Cloud Foundry Command Line Interface –
Download and set up the Cloud Foundry command line interface (cf CLI) to start working with the Cloud Foundry environment. Use the cf CLI to deploy and manage your applications.
Log On to the Cloud Foundry Instance Using the Console Client – Use the cf command line interface (CLI) to log on to the Cloud Foundry space
Deploy Applications – When a Cloud Foundry application resides in a folder on your local machine, you can deploy it and start it by executing the command line interface (CLI) command push.
The intention of the document is to run a simple .Net application on Cloud Foundry instance.
I have downloaded a sample .net application from GitHub and will be running it on cloud foundry instance using the build packs available there.
I have a trial account in one of the cloud foundry servers on AWS.
I have already downloaded the command line interface and now we need to connect this with the trial CF instance on AWS.
You can open your command prompt and execute the following commands as shown in screen shot:
I have chosen org ‘A-Team_Startup_Focus’ and space ‘dev’. You can create and choose the same accordingly.
Now with command ‘cf buildpacks’ you will see all the available buildpacks in this CF instance. This is updated regularly.
Here you can see the dotnet_core_buildpack which will be used to run the application.
After downloading the app from Github, please extract the same and store it on your desktop. In the command prompt go to the place where you have extracted it.
Here you need to run the command ‘cf push’. This is a good read on cf push – https://docs.cloudfoundry.org/buildpacks/use-multiple-buildpacks.html
Please execute ‘cf help push’ to understand more about this command.
Once you do the same,
The command ‘cf push’ takes care running the app on CF instance.
In the end you will get this screen,
If you observe the URL you will see that it is deployed on <cfapps.us10.hana.ondemand.com>. The cf push command also has created an instance and started it, mentioned the usage of the instance, the stack that has been used (cflinuxfs2) and build pack (ASP.NET Core).
On copying the URL in a browser you will see the Hello World app.
URL: https://sample-aspnetcore-helloworld-procontinuation-fibro.cfapps.us10.hana.ondemand.com/
Now you can login to the CF account and check the app:
I loved this tutorial! Thanks a lot! =)
Can we also run any .net application on sap CloudFoundry using RFC protocols?