How to tell if Virtual machine is (un)managed? Meaning whether VM has only (un)managed disks since those cannot be mixed (to my knowledge).
I was originally using Azure Fluent SDK. But I am having some trouble with that and there are even some issues.
Only way to find out is to go over the disk(s) (or check only one since they cannot be mixed up) and check whether disk(s) itself is (un)managed. Is that right?
The question is how to find out whether disk is (un)managed? My first idea is to check OSDisk property (or DataDisk for that matter)
- If it has managedDisk/id property, then it is obviously managed disk.
- If it has vhd/uri property, then it is obviously unmanaged disk.
That seems simple enough (and I am pretty sure it at least 99% of the time works but I really need to be 100% sure) but if you check source code of Fluent SDK library (by Microsoft so what is the better source of truth?) the logic is way more complicated. Also, I have my doubts it is correct (see bug above).
To put it shortly what is in 100% cases reliable way to check whether VM is managed or not?