Site icon TAAGUNG

Cloud Computing : How to deploy an app on IBM Cloud using Cloud Foundry

Latest posts by Tuba Mansoor (see all)

Ever wondered, how to deploy an application to cloud. Here I will give you an introduction how to deploy a sample .NET application to IBM Cloud.  Even though I will be demonstrating with a .NET application, you can tweak it to change it according to your needs to suit applications made in other technologies.

We would be using an IBM cloud account, to deploy our sample app. You can sign up for their trial version.

Prerequisites:

Asp.Net Core (By default Visual Studio 2017 will have Asp.Net core installed. With Visual Studio 2015 you may need extra plugins for the same.)

Step 1: Signing up for a trial IBM Cloud account.

You can sign up for a free trial IBM Cloud account as below: quot;,

Registration page for IBM Cloud

Once you are done with the registration, you would be taken to the dashboard:

IBM Cloud Dashboard

Click on ‘Create Resource’ here. Since I would be deploying an ASP.NET Core app, I will select that as the type of resource that I want to create. You can select the resource as the type of application you want to deploy.

Create a new resource

While creating the resource you have to enter your app name and other details. Remember the app name and the region that you select. This will be required later.

Creating a resource
Your app is created!

Once the app the created, click on ‘Visit App URL’.  It will look as below.

Your app is up!

Note down the URL for your application, as you would be pushing your new .NET application to this URL.

Step 2: Downloading the IBM Cloud CLI

Download IBM Cloud CLI here

Step 3: Creating a sample app

Now lets create a new a sample app to deploy. Lets open visual Studio 2017, and select a new ‘ASP.NET Core Web Application’ as follows:

Created a ASP.NET Core Web Application.
Select ‘Web Application’

Now run this sample application . It will look as below:

Run Sample application

Now we need to publish this app, before deploying it on cloud. Right click on it and select publish details as follows:


Publishing your app
Publishing your app

Step 4: Pushing your sample app to Cloud

Once you have successfully published your app, open your command prompt and type the following command:

Ibmcloud login -u [username]

It will ask for password. Enter it

It will then ask for the region where you want to run it. Select the region that you had selected when creating your IBM Cloud account. If you don’t remember, either check the URL of your app, or go to your IBM Cloud account to find out the region.

Command prompt

Now type the following command to start using cloud foundry commands.

Ibmcloud target –cf

Type in the commands as above

You are now set to push your application to cloud:

Navigate to the folder where you have published your code through command prompt

Type the following command:

cf push [appName]

The appname will be the one that you had entered while creating the IBM Cloud account.

Type in the commands as above

Once the push is successful goto your original url and you will find that the app has been pushed to cloud.

Your app is on cloud!

We have successfully managed to push our app to cloud.

Exit mobile version