Template / Example for a microservice using tenant options to store a secret encrypted on the Cumulocity platform.
Cumulocity tenant options: https://cumulocity.com/guides/reference/tenants/#option
Often used for cloud 2 cloud integration when credentials of other API must be stored encrypted at Cumulocity.
- Build project
mvn clean install
- Create application at cumulocity
POST 'https://{base-url}/application/applications'
Request body:
{
"key": "templates-secret",
"name": "templates-secret",
"contextPath": "templates-secret",
"type": "MICROSERVICE",
"manifest":{},
"requiredRoles": [
"ROLE_OPTION_MANAGEMENT_READ",
"ROLE_OPTION_MANAGEMENT_ADMIN"
],
"roles": [
]
}
-
Subscribe application to your tenant via UI
-
Acquire microservice bootstrap credentials
GET 'https://{base-url}/application/applications/{applicationId}/bootstrapUser
Response body:
{
"password": "************************",
"name": "servicebootstrap_templates-secret",
"tenant": "<your tenant>"
}
- Add bootstrap credentials
to your src/main/resources/application-dev.properties
- Start microservice with spring profile "dev"
java -Dspring.profiles.active=dev -jar cumulocity-microservice-templates-secret-0.0.1-SNAPSHOT.jar
These tools are provided as-is and without warranty or support. They do not constitute part of the Software AG product suite. Users are free to use, fork and modify them, subject to the license agreement. While Software AG welcomes contributions, we cannot guarantee to include every contribution in the master project.
For more information you can Ask a Question in the TECHcommunity Forums.
You can find additional information in the Software AG TECHcommunity.
Contact us at TECHcommunity if you have any questions.