Is there an api or powershell command available to retrieve vmid of a deleted vm in azure. I have a requirement to retrieve this value to update our internal cmdb system. So far tried with change analysis rest apis with no luck, since the ARM template is also removed with VM deletion API calls are returning no value. I can see the vmid in the changed properties of the resource group activity log , just wondering if there a way retrieve this value programmatically. Please let know of anyone has tried this before, any help will be appreciated.
Thanks,
To retrieve
vmidof a deleted azure VM make use of below PowerShell Commands:Output:
You can find
vmidof deleted vm in below HTTP request properties like below: