https://github.com/catalystcode/self-destroy-instance
Self destroy instance in Azure Virtual Machine Scale Sets
https://github.com/catalystcode/self-destroy-instance
azure azure-vm-scale-sets bash docker linux
Last synced: 4 months ago
JSON representation
Self destroy instance in Azure Virtual Machine Scale Sets
- Host: GitHub
- URL: https://github.com/catalystcode/self-destroy-instance
- Owner: CatalystCode
- License: mit
- Created: 2017-08-22T05:10:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-22T06:05:09.000Z (over 8 years ago)
- Last Synced: 2025-03-16T03:14:21.799Z (9 months ago)
- Topics: azure, azure-vm-scale-sets, bash, docker, linux
- Language: Shell
- Size: 2.93 KB
- Stars: 1
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Self destroy instance
Self destroy linux instance in Azure Virtual Machine Scale Sets
## Prerequisites
To use this script, first you need to create an Azure Service Principal through [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli?toc=%2fazure%2fazure-resource-manager%2ftoc.json) or [Azure portal](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal).
## How to use
Define the following environment variables
#### Using Docker
Inside the Dockerfile or use the -e option
```
TENANT_ID = {Directory Id}
CLIENT_ID = {Serivce Principal Id}
CLIENT_SECRET = {Service Principal Secret}
SUBSCRIPTION_ID = {Subscripton Id}
RESOURCE_GROUP = {Resource group name} // Until it will be included in the VM Instance metadata
```
#### Using as a simple script inside the os
```
export TENANT_ID = {Directory Id}
export CLIENT_ID = {Serivce Principal Id}
export CLIENT_SECRET = {Service Principal Secret}
export SUBSCRIPTION_ID = {Subscripton Id}
export RESOURCE_GROUP = {Resource group name} // Until it will be included in the VM Instance metadata
```