- Creating Web Components in Angular - February 23, 2021
- What is your Communication Style? - August 1, 2020
- Sharing is caring? - January 28, 2020
Here we will be deploying an ASP.NET Core app on PCF (Pivotal Cloud Foundry). Though I am using ASP.NET Core project, but the following steps apply for an application created in other technologies too.
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 : Creating an account with Pivotal Cloud Foundry
Create an account on Pivotal Web Services account as below:
Step 2 : Install Cloud Foundry CLI
Install Cloud Foundry CLI.
Once you are done installing cloud foundry, open command prompt and type:
cf help
If it gives you the details it means your cloud foundry cli has been successfully installed.
Step 3 : Create a sample app.
Now let’s create a new a sample app to deploy. Let’s open visual Studio 2017, and select a new ‘ASP.NET Core Web Application’ as follows:
Now run this sample application. It will look as below:
Now we need to publish this app, before deploying it on cloud. Right click on it and select publish details as follows:
Step 4 : Pushing app to cloud
Now lets go to the command prompt and navigate to the folder where the published app is kept. Lets type the following command in the command prompt and press enter:
cf login -a https://api.run.pivotal.io
It will ask for the email and the password that you had used when creating your PCF account.
Then use the following command to push the application to cloud:
cf push [appname that you wanna use]
The url mentioned in the routes is your app url.
Once the app is published as above, navigate to the url mentioned in the routes (refer above screenshot). For this app, the url is ‘taagung.cfapps.io’.
Congratulations! Our app now live on cloud and you successfully deployed an ASP.NET Core app on Pivotal Cloud Foundry!