Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Shashanka
Discoverer

In this blog, we are trying to setup the SAP BTP Command line and cloud foundry, this topic includes, how to install BTP and Cloud Foundry command line. Further, how to login to the Cloud Foundry and BTP command line.

The cli is available for Windows, Linux and MacOS - download the executable as per the need.

Each step has been updated as per the setup made on the windows machine.

1. To setup SAP BTP Command Line interface, download the cli from the below link
https://tools.hana.ondemand.com/

2.In the portal navigate to CLOUD and select

SAP BTP Command Line Interface (btp CLI) ==> Select the CLI as per the Operating System ==> download the package

3. Extract the tar.gz, for example in windows as below

a.   Open the windows PowerShell and execute the below command to extract the tar.gz

tar -xvf .\btp-cli-windows-amd64-2.54.0.tar.gz 

b.   A new folder windows-amd64 will be created and the btp application will be created in the folder.

4. Now login to the CMD and execute the BTP commands5. execute btp
6. Accordingly perform the btp login to the tenant using the btp login command
Btp login --subdomain <subdomain> --user <emailid> --password <password>
7. Accordingly you can use the cf login command to login to the cloud foundry initial setup is needed like downloading the cf libraries, setting up JAVA_HOME - PATH variable,
8. Navigate to the URL https://github.com/cloudfoundry/cli#downloads, navigate to the download section and download the V8 version.
For Microsoft Windows, download the Windows 64-bit installer
9. Once the installation is completed, login to the BTP subaccount using the login command
btp login --subdomain <Subaccount> --user <userid> --password <password>
10. Now navigate to the folder where the cli package is installed <path/Cloud Foundry>
Execute cf command - this will show the version installed
cf version 8.7.5+8aa8625c7.2023-11-20, Cloud Foundry command line tool
Usage: cf [global options] command [arguments...] [command options]
Before getting started:
config login,l target,t
help,h logout,lo

Application lifecycle:
apps,a run-task,rt events
push,p logs set-env,se
start,st ssh create-app-manifest
stop,sp app delete,d
restart,rs env,e apply-manifest
restage,rg scale revisions

Services integration:
marketplace,m create-user-provided-service,cups
services,s update-user-provided-service,uups
create-service,cs create-service-key,csk
update-service delete-service-key,dsk
delete-service,ds service-keys,sk
service service-key
bind-service,bs bind-route-service,brs
unbind-service,us unbind-route-service,urs

Route and domain management:
routes,r delete-route create-private-domain,create-domain
domains map-route
create-route unmap-route

Space management:
spaces create-space,csp set-space-role
space-users delete-space unset-space-role
apply-manifest

Org management:
orgs,o set-org-role
org-users unset-org-role

CLI plugin management:
plugins add-plugin-repo repo-plugins
install-plugin list-plugin-repos

Commands offered by installed plugins:

Global options:
--help, -h Show help
-v Print API request diagnostics to stdout

TIP: Use 'cf help -a' to see all commands.

11. Use CF login to the login to the cloud Foundry - cf login
API endpoint: https://api.cf.us10-001.hana.ondemand.com
Enter Email/User ID and password

Email: < User Name - Email of the BTP tenant>
Password: <Password - Password of the BTP tenant>

Password:

Authenticating...
OK

Select an org:
1.Cloud Foundry Org Subaccount1
2.Cloud Foundry Org Subaccount2

Org (enter to skip):
Targeted org <Org>.

Targeted space dev_space.

API endpoint: https://api.cf.us10-001.hana.ondemand.com
API version: 3.150.0
user:
org:
space: dev_space

In the further, blog, how login can be performed using the SSO, Authentication code will be updated.

Hence, in this way we can download the BTP CLI and Cloud Foundry CLI and install in our machines.

Labels in this area