0

I am trying to call the azure api for fetching the details of a particular VM. I am getting all other details in the response but it is not returning the VHD object. Can anyone please tell me why is this happening and how can this be fixed?

https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}?api-version=2018-06-01

I am trying to call the api like this but it is not returning VHD object.I am getting everything else in api response but VHD object is not being returned.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
paras mehta
  • 159
  • 1
  • 2
  • 7

1 Answers1

0

For your issue, there is something you should make sure what does it mean.

There are only two VHD files that you can see in Azure. One is that you upload the VHD file to the Azure storage account. Another is that you create an unmanaged VM and then you can see the VHD file in the storage account as the VM OS disk. In this time, you can use the API that you refer in the question to show the VM details and the VHD file will show you.

If you create a managed VM, then there will no VHD file you can see in Azure. The disk will show you the resource Id as the managed disk.

If there are any more questions, please let me know. Or if it's helpful you can accept it.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39