Open metaldectr opened 4 years ago
@metaldectr
Could you share your disk ID? The exception seems be caused by invalid resource ID (hence the resource group cannot be extraced).
I get diskId from vm.dataDisks()
VirtualMachine /**
and get Id from this object.
@metaldectr Would you help paste the id here (with redact if you prefer)?
I am fine with my test (with 1.36.0)
var vm = azure.virtualMachines().getById(VM_ID);
var id = vm.dataDisks().entrySet().iterator().next().getValue().id();
var disk = azure.disks().getById(id);
The format of the ID would be
/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.Compute/disks/{disk}
Exception or Stack Trace Caused by java.lang.IllegalArgumentException: Parameter resourceGroupName is required and cannot be null. /opt/lib/azure-mgmt-compute-1.22.0.jar!/com/microsoft/azure/management/compute/implementation/DisksInner.class:529 in getByResourceGroupWithServiceResponseAsync /opt//lib/azure-mgmt-compute-1.22.0.jar!/com/microsoft/azure/management/compute/implementation/DisksInner.class:508 in getByResourceGroupAsync /opt/lib/azure-mgmt-resources-1.22.0.jar!/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/TopLevelModifiableResourcesImpl.class:64 in getInnerAsync /opt/lib/azure-mgmt-resources-1.22.0.jar!/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.class:115 in getByResourceGroupAsync /opt/lib/azure-mgmt-resources-1.22.0.jar!/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.class:80 in getByIdAsync /opt/lib/azure-mgmt-resources-1.22.0.jar!/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.class:69 in getById /opt/lib/azure-mgmt-resources-1.22.0.jar!/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.class:34
Setup (please complete the following information):