How to locate Service Credentials for a Bound Service
search cancel

How to locate Service Credentials for a Bound Service

book

Article ID: 293391

calendar_today

Updated On:

Products

Operations Manager

Issue/Introduction

This article demonstrates how to locate the credentials and connection information for a service instance that is bound to an application running on Tanzu Application Service (TAS) formerly Pivotal Cloud Foundry® (PCF). This is useful if you need to connect directly to the service in question.


Resolution

There are three options to retrieve the connection information:


Web Browser & Developer Console

  1. Access the Console application in your browser.  
  2. Select the organization and space where your service is deployed.  
  3. Under the Services section, locate the service itself.  
  4. Click the Manage link next to the service.  The service provider should then display your credentials.

 

Terminal & CF CLI - Option #1

  1. Open a terminal.
  2. Login with cf, select your organization and space.
  3. Run cf files <app_name> logs/env.log
  4. The output will show the environment variables accessible to your application which includes the service's credentials. In particular, check the VCAP_SERVICES environment variable.

Note: This option will not work when the application has been stopped or has failed to stage.

 

Terminal & CF CLI - Option #2

  1. Open a terminal.
  2. Login with cf, select your organization and space.
  3. Run cf curl /v2/apps
  4. This will output a JSON blob. Locate resources → <app_name> → service_bindings_url
  5. Run cf curl <service_bindings_url>
  6. This will output a JSON blob for each bound service that includes the credentials.


Impact

Please use caution when displaying the credentials from your services. The information will be shown in plain text. 


Additional Information