To undeploy (delete) an mtar
, you don’t need to delete the apps and the services individually. The deploy service on Cloud Foundry keeps track on the deployed mtar
and its resources.
You can undeploy the applications and their service instances. Undeploying the applications and their service instances will also delete the data stored in these instances (for example, database content).
Execute the following command to delete applications and service instances (keep in mind that this will delete all data stored in the application):
cf undeploy cpapp --delete-service-keys --delete-services
Delete applications only.
The undeploy command needs the MTA ID (the MTA ID is the name of your app) as a parameter, you can delete only the applications with the following command:
cf undeploy cpapp
To learn more about the cf undeploy
command, see Undeploy Content.