Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Latest commit

 

History

History
61 lines (30 loc) · 1.54 KB

readme.md

File metadata and controls

61 lines (30 loc) · 1.54 KB

AzureSelfDestruct Build Status

Azure Self Destruct

A library allowing an Azure WebRole/WorkerRole to delete itself from the current deployment.

This will effectively scale down your infrastructure, by powering down the current machine.

This does not work in the emulator.

Installation

You can just copy the SelfDestruct.cs file into your project.

A package is also available on NuGet.

PM> Install-Package Two10.Azure.SelfDestruct

Usage

To start you need a Publish Settings file which can be downloaded here.

If the file contains more than one subscription, you'll need to remove the other subscriptions such that you only have the one in there you want to use.

To delete a machine, simply call 'DeleteInstance':

// immediate annihilation
SelfDestruct.DeleteInstance(@".\path\to\file.publishsettings");

Like all good self-destruction routines, you can also have a countdown:

// gone in 60 seconds
SelfDestruct.DeleteInstance(@".\path\to\file.publishsettings", TimeSpan.FromSeconds(60));

If your deployment only contains one instance, it won't be deleted. You'll need to delete the whole deployment instead.

Acknowledgements

Gaurav Mantri for his code samples.

Richie Custance for his ideas.

License

MIT