Destroy Site in Azure - Esri/arcgis-gitops GitHub Wiki
This walkthrough guides you through using GitHub Actions to destroy the resources created by the Getting Started in Azure walkthrough.
In particular, the walkthrough will:
- Create and configure a codespace workspace in the private GitHub repository
- Destroy the core Azure resources of the site
- Delete the Azure Blob Storage account of the Terraform backend
- Delete the private GitHub repository of the site
Duration: about 30 minutes
Before you begin this walkthrough:
- Destroy all deployments in the ArcGIS Enterprise site.
You will need the following resources and accounts:
- GitHub.com user account
- Service principal in a Microsoft Azure account with the Owner role
This step will create a codespace workspace in the private GitHub repository and configure it to use Azure CLI to destroy the resources created by Getting Started in Azure walkthrough.
Open the GitHub.com URL in a web browser and log in to your GitHub.com account.
Browse to the private repository "gitops-demo" created in Getting Started in Azure walkthrough.
In the new repository, click the green <> Code button, switch to the "Codespaces" tab, and click the Create codespace on main button. The codespace will be created and opened in a new browser tab.
Instead of creating a codespace, you can also reuse the codespace created in Getting Started in Azure walkthrough if it is still available. In this case, you can skip this step and go to step 2.
In the codespace, click on the "Terminal" tab in the bottom panel, and run the following commands:
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bashRun the following commands, replacing <client id>, <client secret>, and <tenant id> with the service principal's credentials:
az login --service-principal --username <client id> --password <client secret> --tenant <tenant id>This step will destroy the Azure resources of the site created by Getting Started in Azure walkthrough.
Run GitHub Actions workflow site-k8s-cluster-azure-destroy to destroy the Azure Kubernetes Service (AKS) cluster.
Click on "Actions" tab in the repository, refresh the web page, select "site-k8s-cluster-azure-destroy" workflow on the left sidebar, click "Run workflow" on the right, and click "Run workflow" button.
This step is not required if the AKS cluster was not created.
Run GitHub Actions workflow "site-ingress-azure-destroy" to destroy the Azure resources created by the "site-ingress-azure" workflow.
This step is not required if the ingress resources were not created.
Run GitHub Actions workflow "site-automation-chef-azure-destroy" to destroy the Azure resources created by "site-automation-chef-azure" workflow.
Click on "Actions" tab in the repository, refresh the web page, select "site-automation-chef-azure-destroy" workflow on the left sidebar, click "Run workflow" on the right, and click "Run workflow" button.
Run GitHub Actions workflow "site-core-azure-destroy" to destroy the Azure resources created by "site-core-azure" workflow.
Click on "Actions" tab in the repository, refresh the web page, select "site-core-azure-destroy" workflow on the left sidebar, click "Run workflow" on the right, and click "Run workflow" button.
Run the following command replacing <storage account name> with the name of the storage account created in Getting Started in Azure walkthrough to delete the storage account used by the Terraform backend.
az storage account delete --name <storage account name> --resource-group arcgis-gitopsThis step deletes the private GitHub repository "gitops-demo" in your GitHub account created in Getting Started in Azure walkthrough.
In the private repository "Settings" tab, click on the "Delete this repository" button, and confirm the deletion.
This walkthrough has guided you through using GitHub Actions to destroy the resources for an ArcGIS Enterprise site created by Getting Started in Azure walkthrough.