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

A library allowing an Azure WebRole/WorkerRole to delete itself

License

Notifications You must be signed in to change notification settings

azure-contrib/AzureSelfDestruct

Repository files navigation

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

About

A library allowing an Azure WebRole/WorkerRole to delete itself

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages