LAMP/managedApplication/Cleanup.md

51 строка
1.5 KiB
Markdown
Исходник Постоянная ссылка Обычный вид История

Add example Managed Application template. (#50) * WIP: initial managedapp templates work. NOTE this is not a real Moodle managed app, it's just the documentation using a sample managed app. I'll make it a real Moodle app soon. See #43. * Add a cleanup script. Separate the Environment setup for easy reuse. some bug fixes. * WIP: Start the move to using the real Moodle templates. Still doesn't work though, got a problem with coercing the SSH key in the CLI and the CreateUIDef is not working on the config blade in the portal. Part of #43 * note we create our own SSH key * fix typo in type name * split monolithic doc into parts * Fix invalid parameters-template.json and some typos * Addressing PR feedback * Fix typos in createUIDefinition.json * Add more param values to parameters-template.json for minimum size and faster deployment * make mysql the default db * update expected results to match ne RG naming * WIP: initial managedapp templates work. NOTE this is not a real Moodle managed app, it's just the documentation using a sample managed app. I'll make it a real Moodle app soon. See #43. * Add a cleanup script. Separate the Environment setup for easy reuse. some bug fixes. * WIP: Start the move to using the real Moodle templates. Still doesn't work though, got a problem with coercing the SSH key in the CLI and the CreateUIDef is not working on the config blade in the portal. Part of #43 * note we create our own SSH key * fix typo in type name * split monolithic doc into parts * Fix invalid parameters-template.json and some typos * Addressing PR feedback * Fix typos in createUIDefinition.json * Add more param values to parameters-template.json for minimum size and faster deployment * make mysql the default db * update expected results to match ne RG naming
2018-03-16 23:23:34 +03:00
# Cleaning up a Test Deployment
If you worked through the documentation in this section you will have
created a nubmer of resources and at least one entry into your Service
Catalog. This document will explain how to remove them all.
## Prerequisites
We need to ensure the [variables](Environment.md) are set up correctly.
## Azure Active Directory
``` bash
2018-03-17 00:35:51 +03:00
MOODLE_MANAGED_APP_AD_ID=$(az ad group list --filter="displayName eq '$MOODLE_MANAGED_APP_OWNER_GROUP_NAME'" --query [0].objectId --output tsv)
Add example Managed Application template. (#50) * WIP: initial managedapp templates work. NOTE this is not a real Moodle managed app, it's just the documentation using a sample managed app. I'll make it a real Moodle app soon. See #43. * Add a cleanup script. Separate the Environment setup for easy reuse. some bug fixes. * WIP: Start the move to using the real Moodle templates. Still doesn't work though, got a problem with coercing the SSH key in the CLI and the CreateUIDef is not working on the config blade in the portal. Part of #43 * note we create our own SSH key * fix typo in type name * split monolithic doc into parts * Fix invalid parameters-template.json and some typos * Addressing PR feedback * Fix typos in createUIDefinition.json * Add more param values to parameters-template.json for minimum size and faster deployment * make mysql the default db * update expected results to match ne RG naming * WIP: initial managedapp templates work. NOTE this is not a real Moodle managed app, it's just the documentation using a sample managed app. I'll make it a real Moodle app soon. See #43. * Add a cleanup script. Separate the Environment setup for easy reuse. some bug fixes. * WIP: Start the move to using the real Moodle templates. Still doesn't work though, got a problem with coercing the SSH key in the CLI and the CreateUIDef is not working on the config blade in the portal. Part of #43 * note we create our own SSH key * fix typo in type name * split monolithic doc into parts * Fix invalid parameters-template.json and some typos * Addressing PR feedback * Fix typos in createUIDefinition.json * Add more param values to parameters-template.json for minimum size and faster deployment * make mysql the default db * update expected results to match ne RG naming
2018-03-16 23:23:34 +03:00
az ad group delete --group $MOODLE_MANAGED_APP_AD_ID
```
## Remove the Service Catalog Entry
``` bash
az managedapp definition delete --resource-group $MOODLE_SERVICE_CATALOG_RG_NAME --ids $MOODLE_MANAGED_APP_ID
```
### Service catalog resource group
If you create a resource group solely for the managed application you
are now deleting you can safely remove its resource group:
``` bash
az group delete --name $MOODLE_SERVICE_CATALOG_RG_NAME --yes
```
## Managed Application
By deleting the managed application Azure will automatically delete
the managed application infrastructure resource group as well (this
was created as part of the managed application deployment).
First we need the application ID.
``` bash
MOODLE_DEPLOYMENT_ID=$(az managedapp show --resource-group $MOODLE_DEPLOYMENT_RG_NAME --name $MOODLE_DEPLOYMENT_NAME)
```
Now we have the ID we can delete the application.
``` bash
az managedapp delete --resource-group $MOODLE_DEPLOYMENT_RG_NAME --ids $MOODLE_DEPLOYMENT_ID
```