Deallocate non-AVD VMs when shutdown by user

%3CLINGO-SUB%20id%3D%22lingo-sub-3029866%22%20slang%3D%22en-US%22%3EDeallocate%20non-AVD%20VMs%20when%20shutdown%20by%20user%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3029866%22%20slang%3D%22en-US%22%3E%3CP%3EThere%20are%20few%20posts%20about%20how%20to%20properly%20deallocate%20VMs%20which%20are%20part%20of%20Azure%20Virtual%20Desktop%20(AVD).%20I'm%20interested%20in%20a%20more%20general%20approach%20-%20possibly%20involving%20some%20kind%20of%20automation.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20automatically%20deallocate%20VMs%20which%20have%20a%20certain%20tag%20and%20are%20shutdown%20by%20the%20user%3F%20Can%20I%20somehow%20detect%20the%20%22shutdown%22%20state%20by%20automation%20and%20process%20it%20accordingly%3F%20I%20don't%20care%20about%20the%20actual%20automation%20tool%2C%20but%20it%20should%20preferably%20work%20on%20the%20Azure%20level%20and%20not%20depend%20on%20a%20certain%20VM%20configuration.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3029866%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECompute%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EVirtual%20Machine%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

There are few posts about how to properly deallocate VMs which are part of Azure Virtual Desktop (AVD). I'm interested in a more general approach - possibly involving some kind of automation.

 

Is there a way to automatically deallocate VMs which have a certain tag and are shutdown by the user? Can I somehow detect the "shutdown" state by automation and process it accordingly? I don't care about the actual automation tool, but it should preferably work on the Azure level and not depend on a certain VM configuration.

0 Replies