I have spent a little time trying to figure out why my deployment using an all-but-stock Azure Website ARM template was failing with the error “No VMs Found in Resource Group”. You see, I am trying to set up my Visual Studio Team Services (VSTS) Release environments. Currently the ‘Release’ extension for VSTS is in preview. As I have learned and come to accept, when things are in preview it usually means the documentation isn’t complete and the workflow may not entirely make sense.
Occasionally I have issues that there are no answers for via searching or asking on Stack Overflow. I will try to record some of those here.
One thing I recently discovered on the Azure Resource Group Deployment task is this funny little box called Output that has an input box labeled ‘Resource Group’. When you hover over the information icon it tells you it is simply for you to provide a name for the variable for the resource group for later use in a task. Being a forward thinker I gave it a name since it didn’t cost me more than a second or two. Later maybe I could use it… or it would cause me issues. Ok, you most likely figured out that this caused me the error “No VMs Found in Resource Group”. I searched all over and eventually found an issue on Github for it. Also, now that I think of it, it doesn’t seem to make sense that this would be output to a variable anyway since it should be a variable from the start. so:
SOLVED: VSTS – Release – Azure Resource Group Deployment – “No VMs Found in Resource Group”
There seems to be a bug when you fill in the Output > ‘Resource Group’ field and you are not using any VMs. Simply clear this field. If you need to I would suggest placing the name in an environment variable and using that is input from the start. Then it will also be available in other tasks.