Cloud Foundry enables you to inject service data directly to your running application. However, you might want to access your database from a local client or from applications running outside of Cloud Foundry. In these cases you will need credentials to your services. They are calles Service Keys.
Creating a Service Key via the Service Dashboard
Access the Service Dashboard for which you want to create a Service Key
Navigate to Service Key in the top menu
You will see an overview on existing Service Keys and you are able to create a new Service key by clicking on the button
Click on the Details button of your newly created Service Key to access credentials and further information
Congratulations. You created a Service Key.
Creating a Service Key via CLI
Login to your CLI
Access your desired space/project
cf serviceswill list your existing services
cf create-service-key yourService yourKeynamewill create a key for your service
List existing Service Keys for your Service
cf service-keys yourServicewill list all existing keys for your service
Get Credentials for a Service Key
cf service-key yourService yourKeynamewill display the credentials for your service